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             package Net::API::Stripe::Identity::VerificationSession;
11             BEGIN
12             {
13 2     2   21476374 use strict;
  2         16  
  2         71  
14 2     2   11 use parent qw( Net::API::Stripe::Generic );
  2         4  
  2         13  
15 2     2   901 our( $VERSION ) = 'v0.1.0';
16             };
17              
18 0     0 1   sub id { return( shift->_set_get_scalar( 'id', @_ ) ); }
19              
20 0     0 1   sub object { return( shift->_set_get_scalar( 'object', @_ ) ); }
21              
22 0     0 1   sub client_secret { return( shift->_set_get_scalar( 'client_secret', @_ ) ); }
23              
24 0     0 1   sub created { return( shift->_set_get_datetime( 'created', @_ ) ); }
25              
26 0     0 1   sub last_error { return( shift->_set_get_class( 'last_error',
27             { code => { type => "scalar" }, reason => { type => "scalar" } }, @_ ) ); }
28              
29 0     0 1   sub last_verification_report { return( shift->_set_get_scalar_or_object( 'last_verification_report', 'Net::API::Stripe::Identity::VerificationReport', @_ ) ); }
30              
31 0     0 1   sub livemode { return( shift->_set_get_boolean( 'livemode', @_ ) ); }
32              
33 0     0 1   sub metadata { return( shift->_set_get_hash( 'metadata', @_ ) ); }
34              
35 0     0 1   sub options { return( shift->_set_get_class( 'options',
36             {
37             document => {
38             definition => {
39             allowed_types => { type => "array" },
40             require_id_number => { type => "boolean" },
41             require_live_capture => { type => "boolean" },
42             require_matching_selfie => { type => "boolean" },
43             },
44             type => "class",
45             },
46             id_number => { type => "hash" },
47             }, @_ ) ); }
48              
49 0     0 1   sub redaction { return( shift->_set_get_object( 'redaction', 'Net::API::Stripe::Balance::Transaction', @_ ) ); }
50              
51 0     0 1   sub status { return( shift->_set_get_scalar( 'status', @_ ) ); }
52              
53 0     0 1   sub type { return( shift->_set_get_scalar( 'type', @_ ) ); }
54              
55 0     0 1   sub url { return( shift->_set_get_uri( 'url', @_ ) ); }
56              
57 0     0 1   sub verified_outputs { return( shift->_set_get_object( 'verified_outputs', 'Net::API::Stripe::Connect::Person', @_ ) ); }
58              
59             1;
60             # NOTE: POD
61             __END__
62              
63             =encoding utf8
64              
65             =head1 NAME
66              
67             Net::API::Stripe::Identity::VerificationSession - The VerificationSession object
68              
69             =head1 SYNOPSIS
70              
71             =head1 VERSION
72              
73             v0.1.0
74              
75             =head1 DESCRIPTION
76              
77             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.
78              
79             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.
80              
81             Related guide: L<The Verification Sessions API|https://stripe.com/docs/identity/verification-sessions>
82              
83             =head1 METHODS
84              
85             =head2 id string
86              
87             Unique identifier for the object.
88              
89             =head2 object string
90              
91             String representing the object's type. Objects of the same type share the same value.
92              
93             =head2 client_secret string
94              
95             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.
96              
97             =head2 created timestamp
98              
99             Time at which the object was created. Measured in seconds since the Unix epoch.
100              
101             =head2 last_error hash
102              
103             If present, this property tells you the last error encountered when processing the verification.
104              
105             It has the following properties:
106              
107             =over 4
108              
109             =item C<code> string
110              
111             A short machine-readable string giving the reason for the verification or user-session failure.
112              
113             =item C<reason> string
114              
115             A message that explains the reason for verification or user-session failure.
116              
117             =back
118              
119             =head2 last_verification_report expandable
120              
121             ID of the most recent VerificationReport. L<Learn more about accessing detailed verification results.|https://stripe.com/docs/identity/verification-sessions#results>
122              
123             When expanded this is an L<Net::API::Stripe::Identity::VerificationReport> object.
124              
125             =head2 livemode boolean
126              
127             Has the value C<true> if the object exists in live mode or the value C<false> if the object exists in test mode.
128              
129             =head2 metadata hash
130              
131             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.
132              
133             =head2 options hash
134              
135             A set of options for the session’s verification checks.
136              
137             It has the following properties:
138              
139             =over 4
140              
141             =item C<document> hash
142              
143             Options that apply to the L<document check|https://stripe.com/docs/identity/verification-checks?type=document>.
144              
145             =over 8
146              
147             =item C<allowed_types> array
148              
149             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.
150              
151             =item C<require_id_number> boolean
152              
153             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.
154              
155             =item C<require_live_capture> boolean
156              
157             Disable image uploads, identity document images have to be captured using the device’s camera.
158              
159             =item C<require_matching_selfie> boolean
160              
161             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>.
162              
163              
164             =back
165              
166             =item C<id_number> hash
167              
168             Options that apply to the L<id number check|https://stripe.com/docs/identity/verification-checks?type=id_number>.
169              
170             =over 8
171              
172             =item C<id_number>
173              
174             This is an empty hash.
175              
176              
177             =back
178              
179             =back
180              
181             =head2 redaction object
182              
183             Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
184              
185             This is a L<Net::API::Stripe::Balance::Transaction> object.
186              
187             =head2 status string
188              
189             Status of this VerificationSession. L<Learn more about the lifecycle of sessions|https://stripe.com/docs/identity/how-sessions-work>.
190              
191             =head2 type string
192              
193             The type of L<verification check|https://stripe.com/docs/identity/verification-checks> to be performed.
194              
195             =head2 url string
196              
197             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.
198              
199             =head2 verified_outputs object
200              
201             The user’s verified data.
202              
203             This is a L<Net::API::Stripe::Connect::Person> object.
204              
205             =head1 API SAMPLE
206              
207             [
208             {
209             "client_secret" : null,
210             "created" : "1662261086",
211             "id" : "vs_1Le9F42eZvKYlo2Chf4NfVUc",
212             "last_error" : null,
213             "last_verification_report" : "vr_MMt18CcerTGCqLkvTzwaSqfw",
214             "livemode" : 0,
215             "metadata" : {},
216             "object" : "identity.verification_session",
217             "options" : {
218             "document" : {
219             "require_matching_selfie" : 1
220             }
221             },
222             "redaction" : null,
223             "status" : "verified",
224             "type" : "document",
225             "url" : null
226             }
227             ]
228              
229             =head1 HISTORY
230              
231             =head2 v0.1.0
232              
233             Initial version
234              
235             =head1 AUTHOR
236              
237             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
238              
239             =head1 SEE ALSO
240              
241             L<Stripe API documentation|https://stripe.com/docs/api/identity/verification_sessions>
242              
243             =head1 COPYRIGHT & LICENSE
244              
245             Copyright (c) 2019-2022 DEGUEST Pte. Ltd.
246              
247             You can use, copy, modify and redistribute this package and associated
248             files under the same terms as Perl itself.
249              
250             =cut