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