File Coverage

lib/Net/API/Stripe/Connect/Account/Requirements.pm
Criterion Covered Total %
statement 19 27 70.3
branch n/a
condition n/a
subroutine 7 15 46.6
pod 8 8 100.0
total 34 50 68.0


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Connect/Account/Requirements.pm
3             ## Version v0.101.0
4             ## Copyright(c) 2019 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2019/11/02
7             ## Modified 2022/10/29
8             ##
9             ##----------------------------------------------------------------------------
10             package Net::API::Stripe::Connect::Account::Requirements;
11             BEGIN
12             {
13 2     2   21176860 use strict;
  2         15  
  2         60  
14 2     2   10 use warnings;
  2         41  
  2         67  
15 2     2   11 use parent qw( Net::API::Stripe::Generic );
  2         3  
  2         11  
16 2     2   146 use vars qw( $VERSION );
  2         5  
  2         143  
17 2     2   43 our( $VERSION ) = 'v0.101.0';
18             };
19              
20 2     2   11 use strict;
  2         4  
  2         39  
21 2     2   19 use warnings;
  2         4  
  2         435  
22              
23 0     0 1   sub alternatives { return( shift->_set_get_class_array( 'alternatives',
24             {
25             alternative_fields_due => { type => "array" },
26             original_fields_due => { type => "array" },
27             }, @_ ) ); }
28              
29 0     0 1   sub current_deadline { return( shift->_set_get_datetime( 'current_deadline', @_ ) ); }
30              
31 0     0 1   sub currently_due { return( shift->_set_get_array( 'currently_due', @_ ) ); }
32              
33 0     0 1   sub disabled_reason { return( shift->_set_get_scalar( 'disabled_reason', @_ ) ); }
34              
35             # sub errors { return( shift->_set_get_array( 'errors', @_ ) ); }
36              
37             sub errors
38             {
39 0     0 1   return( shift->_set_get_class_array( 'errors',
40             {
41             code => { type => 'scalar' },
42             reason => { type => 'scalar' },
43             requirement => { type => 'scalar' },
44             })
45             );
46             }
47              
48 0     0 1   sub eventually_due { return( shift->_set_get_array( 'eventually_due', @_ ) ); }
49              
50 0     0 1   sub past_due { return( shift->_set_get_array( 'past_due', @_ ) ); }
51              
52 0     0 1   sub pending_verification { return( shift->_set_get_array( 'pending_verification', @_ ) ); }
53              
54             1;
55              
56             __END__
57              
58             =encoding utf8
59              
60             =head1 NAME
61              
62             Net::API::Stripe::Connect::Account::Requirements - A Stripe Account Requirements Object
63              
64             =head1 SYNOPSIS
65              
66             my $req = $stripe->person->requirements({
67             current_deadline => '2020-05-01',
68             errors => [
69             {
70             code => 'invalid_address_city_state_postal_code',
71             reason => 'Some reason why this failed',
72             requirement => 'some_field',
73             }
74             ],
75             });
76              
77             =head1 VERSION
78              
79             v0.101.0
80              
81             =head1 DESCRIPTION
82              
83             Information about the requirements for this person, including what information needs to be collected, and by when.
84              
85             This is instantiated from method B<requirements> in modules L<Net::API::Stripe::Connect::Account>, L<Net::API::Stripe::Connect::Person> and L<Net::API::Stripe::Issuing::Card::Holder>
86              
87             =head1 CONSTRUCTOR
88              
89             =head2 new( %ARG )
90              
91             Creates a new L<Net::API::Stripe::Connect::Account::Requirements> object.
92             It may also take an hash like arguments, that also are method of the same name.
93              
94             =head1 METHODS
95              
96             =head2 alternatives array of hash
97              
98             Fields that are due and can be satisfied by providing the corresponding alternative fields instead.
99              
100             It has the following properties:
101              
102             =over 4
103              
104             =item C<alternative_fields_due> string_array
105              
106             Fields that can be provided to satisfy all fields in C<original_fields_due>.
107              
108             =item C<original_fields_due> string_array
109              
110             Fields that are due and can be satisfied by providing all fields in C<alternative_fields_due>.
111              
112             =back
113              
114             =head2 current_deadline timestamp
115              
116             The date the fields in currently_due must be collected by to keep the capability enabled for the account.
117              
118             This is a C<DateTime> object;
119              
120             =head2 currently_due array containing strings
121              
122             Fields that need to be collected to keep the person’s account enabled. If not collected by the account’s current_deadline, these fields appear in past_due as well, and the account is disabled.
123              
124             =head2 disabled_reason string
125              
126             If the capability is disabled, this string describes why. Possible values are requirement.fields_needed, pending.onboarding, pending.review, rejected_fraud, or rejected.other.
127              
128             =head2 errors array of hash
129              
130             The fields that need to be collected again because validation or verification failed for some reason.
131              
132             This is an array reference of virtual objects class L<Net::API::Stripe::Connect::Account::Requirements::Errors>
133              
134             =over 4
135              
136             =item I<code> The code for the type of error. Possible enum values
137              
138             =over 4
139              
140             =item I<invalid_address_city_state_postal_code>
141              
142             The combination of the city, state, and postal code in the provided address could not be validated.
143              
144             =item I<invalid_street_address>
145              
146             The street name and/or number for the provided address could not be validated.
147              
148             =item I<invalid_value_other>
149              
150             An invalid value was provided for the related field. This is a general error code.
151              
152             =item I<verification_document_address_mismatch>
153              
154             The address on the document did not match the address on the account. Upload a document with a matching address or update the address on the account.
155              
156             =item I<verification_document_address_missing>
157              
158             The company address was missing on the document. Upload a document that includes the address.
159              
160             =item I<verification_document_corrupt>
161              
162             The uploaded file for the document was invalid or corrupt. Upload a new file of the document.
163              
164             =item I<verification_document_country_not_supported>
165              
166             The provided document was from an unsupported country.
167              
168             =item I<verification_document_dob_mismatch>
169              
170             The date of birth (DOB) on the document did not match the DOB on the account. Upload a document with a matching DOB or update the DOB on the account.
171              
172             =item I<verification_document_duplicate_type>
173              
174             The same type of document was used twice. Two unique types of documents are required for verification. Upload two different documents.
175              
176             =item I<verification_document_expired>
177              
178             The document could not be used for verification because it has expired. If it’s an identity document, its expiration date must be before the date the document was submitted. If it’s an address document, the issue date must be within the last six months.
179              
180             =item I<verification_document_failed_copy>
181              
182             The document could not be verified because it was detected as a copy (e.g., photo or scan). Upload the original document.
183              
184             =item I<verification_document_failed_greyscale>
185              
186             The document could not be used for verification because it was in greyscale. Upload a color copy of the document.
187              
188             =item I<verification_document_failed_other>
189              
190             The document could not be verified for an unknown reason. Ensure that the document follows the guidelines for document uploads.
191              
192             =item I<verification_document_failed_test_mode>
193              
194             A test data helper was supplied to simulate verification failure. Refer to the documentation for test file tokens.
195              
196             =item I<verification_document_fraudulent>
197              
198             The document was identified as altered or falsified.
199              
200             =item I<verification_document_id_number_mismatch>
201              
202             The company ID number on the account could not be verified. Correct any errors in the ID number field or upload a document that includes the ID number.
203              
204             =item I<verification_document_id_number_missing>
205              
206             The company ID number was missing on the document. Upload a document that includes the ID number.
207              
208             =item I<verification_document_incomplete>
209              
210             The document was cropped or missing important information. Upload a complete scan of the document.
211              
212             =item I<verification_document_invalid>
213              
214             The uploaded file was not one of the valid document types. Upload an acceptable ID document (e.g., ID card or passport).
215              
216             =item I<verification_document_manipulated>
217              
218             The document was identified as altered or falsified.
219              
220             =item I<verification_document_missing_back>
221              
222             The uploaded file was missing the back of the document. Upload a complete scan of the document.
223              
224             =item I<verification_document_missing_front>
225              
226             The uploaded file was missing the front of the document. Upload a complete scan of the document.
227              
228             =item I<verification_document_name_mismatch>
229              
230             The name on the document did not match the name on the account. Upload a document with a matching name or update the name on the account.
231              
232             =item I<verification_document_name_missing>
233              
234             The company name was missing on the document. Upload a document that includes the company name.
235              
236             =item I<verification_document_nationality_mismatch>
237              
238             The nationality on the document did not match the person’s stated nationality. Update the person’s stated nationality, or upload a document that matches it.
239              
240             =item I<verification_document_not_readable>
241              
242             The document could not be read. Ensure that the document follows the guidelines for document uploads.
243              
244             =item I<verification_document_not_uploaded>
245              
246             No document was uploaded. Upload the document again.
247              
248             =item I<verification_document_photo_mismatch>
249              
250             The document was identified as altered or falsified.
251              
252             =item I<verification_document_too_large>
253              
254             The uploaded file exceeded the 10 MB size limit. Resize the document and upload the new file.
255              
256             =item I<verification_document_type_not_supported>
257              
258             The provided document type was not accepted as proof of identity. Upload an acceptable ID document (e.g., ID card or passport).
259              
260             =item I<verification_failed_address_match>
261              
262             The address on the account could not be verified. Correct any errors in the address field or upload a document that includes the address.
263              
264             =item I<verification_failed_business_iec_number>
265              
266             The Importer Exporter Code (IEC) number could not be verified. Correct any errors in the company’s IEC number field. (India only)
267              
268             =item I<verification_failed_document_match>
269              
270             The document could not be verified. Upload a document that includes the company name, ID number, and address fields.
271              
272             =item I<verification_failed_id_number_match>
273              
274             The company ID number on the account could not be verified. Correct any errors in the ID number field or upload a document that includes the ID number.
275              
276             =item I<verification_failed_keyed_identity>
277              
278             The person’s keyed-in identity information could not be verified. Correct any errors or upload a document that matches the identity fields (e.g., name and date of birth) entered.
279              
280             =item I<verification_failed_keyed_match>
281              
282             The keyed-in information on the account could not be verified. Correct any errors in the company name, ID number, or address fields. You can also upload a document that includes those fields.
283              
284             =item I<verification_failed_name_match>
285              
286             The company name on the account could not be verified. Correct any errors in the company name field or upload a document that includes the company name.
287              
288             =item I<verification_failed_other>
289              
290             Verification failed for an unknown reason. Correct any errors and resubmit the required fields.
291              
292             =back
293              
294             =item I<reason>
295              
296             =item I<requirement>
297              
298             =back
299              
300             =head2 eventually_due array containing strings
301              
302             Fields that need to be collected assuming all volume thresholds are reached. As fields are needed, they are moved to currently_due and the account’s current_deadline is set.
303              
304             =head2 past_due array containing strings
305              
306             Fields that weren’t collected by the account’s current_deadline. These fields need to be collected to enable payouts for the person’s account.
307              
308             =head2 pending_verification array containing strings
309              
310             Fields that may become required depending on the results of verification or review. An empty array unless an asynchronous verification is pending. If verification fails, the fields in this array become required and move to currently_due or past_due.
311              
312             =head1 API SAMPLE
313              
314             {
315             "id": "person_fake123456789",
316             "object": "person",
317             "account": "acct_fake123456789",
318             "created": 1571602397,
319             "dob": {
320             "day": null,
321             "month": null,
322             "year": null
323             },
324             "first_name_kana": null,
325             "first_name_kanji": null,
326             "gender": null,
327             "last_name_kana": null,
328             "last_name_kanji": null,
329             "metadata": {},
330             "relationship": {
331             "director": false,
332             "executive": false,
333             "owner": false,
334             "percent_ownership": null,
335             "representative": false,
336             "title": null
337             },
338             "requirements": {
339             "currently_due": [],
340             "eventually_due": [],
341             "past_due": [],
342             "pending_verification": []
343             },
344             "verification": {
345             "additional_document": {
346             "back": null,
347             "details": null,
348             "details_code": null,
349             "front": null
350             },
351             "details": null,
352             "details_code": null,
353             "document": {
354             "back": null,
355             "details": null,
356             "details_code": null,
357             "front": null
358             },
359             "status": "unverified"
360             }
361             }
362              
363             =head1 HISTORY
364              
365             =head2 v0.1
366              
367             Initial version
368              
369             =head1 AUTHOR
370              
371             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
372              
373             =head1 SEE ALSO
374              
375             Stripe API documentation:
376              
377             L<https://stripe.com/docs/api>
378              
379             =head1 COPYRIGHT & LICENSE
380              
381             Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
382              
383             You can use, copy, modify and redistribute this package and associated
384             files under the same terms as Perl itself.
385              
386             =cut