-
Notifications
You must be signed in to change notification settings - Fork 355
/
BankAccount.java
747 lines (686 loc) · 32.2 KB
/
BankAccount.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
// File generated from our OpenAPI spec
package com.stripe.model;
import com.google.gson.annotations.SerializedName;
import com.stripe.exception.InvalidRequestException;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiMode;
import com.stripe.net.ApiRequest;
import com.stripe.net.ApiRequestParams;
import com.stripe.net.ApiResource;
import com.stripe.net.BaseAddress;
import com.stripe.net.RequestOptions;
import com.stripe.net.StripeResponseGetter;
import com.stripe.param.BankAccountUpdateOnAccountParams;
import com.stripe.param.BankAccountUpdateOnCustomerParams;
import com.stripe.param.BankAccountVerifyParams;
import java.util.List;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
/**
* These bank accounts are payment methods on {@code Customer} objects.
*
* <p>On the other hand <a href="https://stripe.com/api#external_accounts">External Accounts</a> are
* transfer destinations on {@code Account} objects for accounts where <a
* href="https://stripe.com/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a>
* is {@code application}, which includes <a
* href="https://stripe.com/connect/custom-accounts">Custom accounts</a>. They can be bank accounts
* or debit cards as well, and are documented in the links above.
*
* <p>Related guide: <a href="https://stripe.com/payments/bank-debits-transfers">Bank debits and
* transfers</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class BankAccount extends ApiResource
implements MetadataStore<BankAccount>, ExternalAccount, PaymentSource {
/** The ID of the account that the bank account is associated with. */
@SerializedName("account")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Account> account;
/** The name of the person or business that owns the bank account. */
@SerializedName("account_holder_name")
String accountHolderName;
/**
* The type of entity that holds the account. This can be either {@code individual} or {@code
* company}.
*/
@SerializedName("account_holder_type")
String accountHolderType;
/**
* The bank account type. This can only be {@code checking} or {@code savings} in most countries.
* In Japan, this can only be {@code futsu} or {@code toza}.
*/
@SerializedName("account_type")
String accountType;
/**
* A set of available payout methods for this bank account. Only values from this set should be
* passed as the {@code method} when creating a payout.
*/
@SerializedName("available_payout_methods")
List<String> availablePayoutMethods;
/** Name of the bank associated with the routing number (e.g., {@code WELLS FARGO}). */
@SerializedName("bank_name")
String bankName;
/** Two-letter ISO code representing the country the bank account is located in. */
@SerializedName("country")
String country;
/**
* Three-letter <a href="https://stripe.com/docs/payouts">ISO code for the currency</a> paid out
* to the bank account.
*/
@SerializedName("currency")
String currency;
/** The ID of the customer that the bank account is associated with. */
@SerializedName("customer")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Customer> customer;
/** Whether this bank account is the default external account for its currency. */
@SerializedName("default_for_currency")
Boolean defaultForCurrency;
/** Always true for a deleted object. */
@SerializedName("deleted")
Boolean deleted;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether
* two bank accounts are the same.
*/
@SerializedName("fingerprint")
String fingerprint;
/**
* Information about the <a
* href="https://stripe.com/docs/connect/custom-accounts/future-requirements">upcoming new
* requirements for the bank account</a>, including what information needs to be collected, and by
* when.
*/
@SerializedName("future_requirements")
FutureRequirements futureRequirements;
/** Unique identifier for the object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;
/** The last four digits of the bank account number. */
@SerializedName("last4")
String last4;
/**
* 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.
*/
@Getter(onMethod_ = {@Override})
@SerializedName("metadata")
Map<String, String> metadata;
/**
* String representing the object's type. Objects of the same type share the same value.
*
* <p>Equal to {@code bank_account}.
*/
@SerializedName("object")
String object;
/**
* Information about the requirements for the bank account, including what information needs to be
* collected.
*/
@SerializedName("requirements")
Requirements requirements;
/** The routing transit number for the bank account. */
@SerializedName("routing_number")
String routingNumber;
/**
* For bank accounts, possible values are {@code new}, {@code validated}, {@code verified}, {@code
* verification_failed}, or {@code errored}. A bank account that hasn't had any activity or
* validation performed is {@code new}. If Stripe can determine that the bank account exists, its
* status will be {@code validated}. Note that there often isn’t enough information to know (e.g.,
* for smaller credit unions), and the validation is not always run. If customer bank account
* verification has succeeded, the bank account status will be {@code verified}. If the
* verification failed for any reason, such as microdeposit failure, the status will be {@code
* verification_failed}. If a payout sent to this bank account fails, we'll set the status to
* {@code errored} and will not continue to send <a
* href="https://stripe.com/docs/payouts#payout-schedule">scheduled payouts</a> until the bank
* details are updated.
*
* <p>For external accounts, possible values are {@code new}, {@code errored} and {@code
* verification_failed}. If a payout fails, the status is set to {@code errored} and scheduled
* payouts are stopped until account details are updated. In the US and India, if we can't <a
* href="https://support.stripe.com/questions/bank-account-ownership-verification">verify the
* owner of the bank account</a>, we'll set the status to {@code verification_failed}. Other
* validations aren't run against external accounts because they're only used for payouts. This
* means the other statuses don't apply.
*/
@SerializedName("status")
String status;
/** Get ID of expandable {@code account} object. */
public String getAccount() {
return (this.account != null) ? this.account.getId() : null;
}
public void setAccount(String id) {
this.account = ApiResource.setExpandableFieldId(id, this.account);
}
/** Get expanded {@code account}. */
public Account getAccountObject() {
return (this.account != null) ? this.account.getExpanded() : null;
}
public void setAccountObject(Account expandableObject) {
this.account = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
}
/** Get ID of expandable {@code customer} object. */
public String getCustomer() {
return (this.customer != null) ? this.customer.getId() : null;
}
public void setCustomer(String id) {
this.customer = ApiResource.setExpandableFieldId(id, this.customer);
}
/** Get expanded {@code customer}. */
public Customer getCustomerObject() {
return (this.customer != null) ? this.customer.getExpanded() : null;
}
public void setCustomerObject(Customer expandableObject) {
this.customer = new ExpandableField<Customer>(expandableObject.getId(), expandableObject);
}
/** Verify a specified bank account for a given customer. */
public BankAccount verify() throws StripeException {
return verify((Map<String, Object>) null, (RequestOptions) null);
}
/** Verify a specified bank account for a given customer. */
public BankAccount verify(RequestOptions options) throws StripeException {
return verify((Map<String, Object>) null, options);
}
/** Verify a specified bank account for a given customer. */
public BankAccount verify(Map<String, Object> params) throws StripeException {
return verify(params, (RequestOptions) null);
}
/** Verify a specified bank account for a given customer. */
public BankAccount verify(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/customers/%s/sources/%s/verify",
ApiResource.urlEncodeId(this.getCustomer()), ApiResource.urlEncodeId(this.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return getResponseGetter().request(request, BankAccount.class);
}
/** Verify a specified bank account for a given customer. */
public BankAccount verify(BankAccountVerifyParams params) throws StripeException {
return verify(params, (RequestOptions) null);
}
/** Verify a specified bank account for a given customer. */
public BankAccount verify(BankAccountVerifyParams params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/customers/%s/sources/%s/verify",
ApiResource.urlEncodeId(this.getCustomer()), ApiResource.urlEncodeId(this.getId()));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getResponseGetter().request(request, BankAccount.class);
}
/**
* Updates the metadata, account holder name, and account holder type of a bank account belonging
* to a <a href="https://stripe.com/docs/connect/custom-accounts">Custom account</a>, and
* optionally sets it as the default for its currency. Other bank account details are not editable
* by design.
*
* <p>You can re-enable a disabled bank account by performing an update call without providing any
* arguments or changes.
*
* <p>Updates the <code>account_holder_name</code>, <code>account_holder_type</code>, and <code>
* metadata</code> of a bank account belonging to a customer. Other bank account details are not
* editable, by design.
*/
@Override
public BankAccount update(Map<String, Object> params) throws StripeException {
return update(params, (RequestOptions) null);
}
/**
* Updates the metadata, account holder name, and account holder type of a bank account belonging
* to a <a href="https://stripe.com/docs/connect/custom-accounts">Custom account</a>, and
* optionally sets it as the default for its currency. Other bank account details are not editable
* by design.
*
* <p>You can re-enable a disabled bank account by performing an update call without providing any
* arguments or changes.
*
* <p>Updates the <code>account_holder_name</code>, <code>account_holder_type</code>, and <code>
* metadata</code> of a bank account belonging to a customer. Other bank account details are not
* editable, by design.
*/
@Override
public BankAccount update(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url;
if (this.getAccount() != null) {
url =
String.format(
"/v1/accounts/%s/external_accounts/%s",
ApiResource.urlEncodeId(this.getAccount()), ApiResource.urlEncodeId(this.getId()));
} else if (this.getCustomer() != null) {
url =
String.format(
"/v1/customers/%s/sources/%s",
ApiResource.urlEncodeId(this.getCustomer()), ApiResource.urlEncodeId(this.getId()));
} else {
throw new InvalidRequestException(
"Unable to construct url because [account, customer] field(s) are all null",
null,
null,
null,
0,
null);
}
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, url, params, options, ApiMode.V1);
return getResponseGetter().request(request, BankAccount.class);
}
/**
* Updates the metadata, account holder name, and account holder type of a bank account belonging
* to a <a href="https://stripe.com/docs/connect/custom-accounts">Custom account</a>, and
* optionally sets it as the default for its currency. Other bank account details are not editable
* by design.
*
* <p>You can re-enable a disabled bank account by performing an update call without providing any
* arguments or changes.
*
* <p>Updates the <code>account_holder_name</code>, <code>account_holder_type</code>, and <code>
* metadata</code> of a bank account belonging to a customer. Other bank account details are not
* editable, by design.
*/
public BankAccount update(BankAccountUpdateOnAccountParams params) throws StripeException {
return update(params, (RequestOptions) null);
}
/**
* Updates the metadata, account holder name, and account holder type of a bank account belonging
* to a <a href="https://stripe.com/docs/connect/custom-accounts">Custom account</a>, and
* optionally sets it as the default for its currency. Other bank account details are not editable
* by design.
*
* <p>You can re-enable a disabled bank account by performing an update call without providing any
* arguments or changes.
*
* <p>Updates the <code>account_holder_name</code>, <code>account_holder_type</code>, and <code>
* metadata</code> of a bank account belonging to a customer. Other bank account details are not
* editable, by design.
*/
public BankAccount update(BankAccountUpdateOnAccountParams params, RequestOptions options)
throws StripeException {
String url;
if (this.getAccount() != null) {
url =
String.format(
"/v1/accounts/%s/external_accounts/%s",
ApiResource.urlEncodeId(this.getAccount()), ApiResource.urlEncodeId(this.getId()));
} else {
throw new InvalidRequestException(
"Unable to construct url because [account] field(s) are all null",
null,
null,
null,
0,
null);
}
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
url,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getResponseGetter().request(request, BankAccount.class);
}
/**
* Updates the metadata, account holder name, and account holder type of a bank account belonging
* to a <a href="https://stripe.com/docs/connect/custom-accounts">Custom account</a>, and
* optionally sets it as the default for its currency. Other bank account details are not editable
* by design.
*
* <p>You can re-enable a disabled bank account by performing an update call without providing any
* arguments or changes.
*
* <p>Updates the <code>account_holder_name</code>, <code>account_holder_type</code>, and <code>
* metadata</code> of a bank account belonging to a customer. Other bank account details are not
* editable, by design.
*/
public BankAccount update(BankAccountUpdateOnCustomerParams params) throws StripeException {
return update(params, (RequestOptions) null);
}
/**
* Updates the metadata, account holder name, and account holder type of a bank account belonging
* to a <a href="https://stripe.com/docs/connect/custom-accounts">Custom account</a>, and
* optionally sets it as the default for its currency. Other bank account details are not editable
* by design.
*
* <p>You can re-enable a disabled bank account by performing an update call without providing any
* arguments or changes.
*
* <p>Updates the <code>account_holder_name</code>, <code>account_holder_type</code>, and <code>
* metadata</code> of a bank account belonging to a customer. Other bank account details are not
* editable, by design.
*/
public BankAccount update(BankAccountUpdateOnCustomerParams params, RequestOptions options)
throws StripeException {
String url;
if (this.getCustomer() != null) {
url =
String.format(
"/v1/customers/%s/sources/%s",
ApiResource.urlEncodeId(this.getCustomer()), ApiResource.urlEncodeId(this.getId()));
} else {
throw new InvalidRequestException(
"Unable to construct url because [customer] field(s) are all null",
null,
null,
null,
0,
null);
}
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
url,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getResponseGetter().request(request, BankAccount.class);
}
/**
* Delete a specified external account for a given account.
*
* <p>Delete a specified source for a given customer.
*/
@Override
public BankAccount delete() throws StripeException {
return delete((Map<String, Object>) null, (RequestOptions) null);
}
/**
* Delete a specified external account for a given account.
*
* <p>Delete a specified source for a given customer.
*/
@Override
public BankAccount delete(RequestOptions options) throws StripeException {
return delete((Map<String, Object>) null, options);
}
/**
* Delete a specified external account for a given account.
*
* <p>Delete a specified source for a given customer.
*/
@Override
public BankAccount delete(Map<String, Object> params) throws StripeException {
return delete(params, (RequestOptions) null);
}
/**
* Delete a specified external account for a given account.
*
* <p>Delete a specified source for a given customer.
*/
@Override
public BankAccount delete(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url;
if (this.getAccount() != null) {
url =
String.format(
"/v1/accounts/%s/external_accounts/%s",
ApiResource.urlEncodeId(this.getAccount()), ApiResource.urlEncodeId(this.getId()));
} else if (this.getCustomer() != null) {
url =
String.format(
"/v1/customers/%s/sources/%s",
ApiResource.urlEncodeId(this.getCustomer()), ApiResource.urlEncodeId(this.getId()));
} else {
throw new InvalidRequestException(
"Unable to construct url because [account, customer] field(s) are all null",
null,
null,
null,
0,
null);
}
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.DELETE, url, params, options, ApiMode.V1);
return getResponseGetter().request(request, BankAccount.class);
}
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class FutureRequirements extends StripeObject {
/**
* Fields that need to be collected to keep the external account enabled. If not collected by
* {@code current_deadline}, these fields appear in {@code past_due} as well, and the account is
* disabled.
*/
@SerializedName("currently_due")
List<String> currentlyDue;
/**
* Fields that are {@code currently_due} and need to be collected again because validation or
* verification failed.
*/
@SerializedName("errors")
List<BankAccount.FutureRequirements.Errors> errors;
/**
* Fields that weren't collected by {@code current_deadline}. These fields need to be collected
* to enable the external account.
*/
@SerializedName("past_due")
List<String> pastDue;
/**
* Fields that might become required depending on the results of verification or review. It's an
* empty array unless an asynchronous verification is pending. If verification fails, these
* fields move to {@code eventually_due}, {@code currently_due}, or {@code past_due}. Fields
* might appear in {@code eventually_due}, {@code currently_due}, or {@code past_due} and in
* {@code pending_verification} if verification fails but another verification is still pending.
*/
@SerializedName("pending_verification")
List<String> pendingVerification;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Errors extends StripeObject {
/**
* The code for the type of error.
*
* <p>One of {@code invalid_address_city_state_postal_code}, {@code
* invalid_address_highway_contract_box}, {@code invalid_address_private_mailbox}, {@code
* invalid_business_profile_name}, {@code invalid_business_profile_name_denylisted}, {@code
* invalid_company_name_denylisted}, {@code invalid_dob_age_over_maximum}, {@code
* invalid_dob_age_under_18}, {@code invalid_dob_age_under_minimum}, {@code
* invalid_product_description_length}, {@code invalid_product_description_url_match}, {@code
* invalid_representative_country}, {@code invalid_statement_descriptor_business_mismatch},
* {@code invalid_statement_descriptor_denylisted}, {@code
* invalid_statement_descriptor_length}, {@code
* invalid_statement_descriptor_prefix_denylisted}, {@code
* invalid_statement_descriptor_prefix_mismatch}, {@code invalid_street_address}, {@code
* invalid_tax_id}, {@code invalid_tax_id_format}, {@code invalid_tos_acceptance}, {@code
* invalid_url_denylisted}, {@code invalid_url_format}, {@code invalid_url_length}, {@code
* invalid_url_web_presence_detected}, {@code
* invalid_url_website_business_information_mismatch}, {@code invalid_url_website_empty},
* {@code invalid_url_website_inaccessible}, {@code
* invalid_url_website_inaccessible_geoblocked}, {@code
* invalid_url_website_inaccessible_password_protected}, {@code
* invalid_url_website_incomplete}, {@code
* invalid_url_website_incomplete_cancellation_policy}, {@code
* invalid_url_website_incomplete_customer_service_details}, {@code
* invalid_url_website_incomplete_legal_restrictions}, {@code
* invalid_url_website_incomplete_refund_policy}, {@code
* invalid_url_website_incomplete_return_policy}, {@code
* invalid_url_website_incomplete_terms_and_conditions}, {@code
* invalid_url_website_incomplete_under_construction}, {@code invalid_url_website_other},
* {@code invalid_value_other}, {@code verification_directors_mismatch}, {@code
* verification_document_address_mismatch}, {@code verification_document_address_missing},
* {@code verification_document_corrupt}, {@code verification_document_country_not_supported},
* {@code verification_document_directors_mismatch}, {@code
* verification_document_dob_mismatch}, {@code verification_document_duplicate_type}, {@code
* verification_document_expired}, {@code verification_document_failed_copy}, {@code
* verification_document_failed_greyscale}, {@code verification_document_failed_other}, {@code
* verification_document_failed_test_mode}, {@code verification_document_fraudulent}, {@code
* verification_document_id_number_mismatch}, {@code verification_document_id_number_missing},
* {@code verification_document_incomplete}, {@code verification_document_invalid}, {@code
* verification_document_issue_or_expiry_date_missing}, {@code
* verification_document_manipulated}, {@code verification_document_missing_back}, {@code
* verification_document_missing_front}, {@code verification_document_name_mismatch}, {@code
* verification_document_name_missing}, {@code verification_document_nationality_mismatch},
* {@code verification_document_not_readable}, {@code verification_document_not_signed},
* {@code verification_document_not_uploaded}, {@code verification_document_photo_mismatch},
* {@code verification_document_too_large}, {@code verification_document_type_not_supported},
* {@code verification_extraneous_directors}, {@code verification_failed_address_match},
* {@code verification_failed_business_iec_number}, {@code
* verification_failed_document_match}, {@code verification_failed_id_number_match}, {@code
* verification_failed_keyed_identity}, {@code verification_failed_keyed_match}, {@code
* verification_failed_name_match}, {@code verification_failed_other}, {@code
* verification_failed_representative_authority}, {@code
* verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code
* verification_failed_tax_id_not_issued}, {@code verification_missing_directors}, {@code
* verification_missing_executives}, {@code verification_missing_owners}, or {@code
* verification_requires_additional_memorandum_of_associations}.
*/
@SerializedName("code")
String code;
/**
* An informative message that indicates the error type and provides additional details about
* the error.
*/
@SerializedName("reason")
String reason;
/**
* The specific user onboarding requirement field (in the requirements hash) that needs to be
* resolved.
*/
@SerializedName("requirement")
String requirement;
}
}
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Requirements extends StripeObject {
/**
* Fields that need to be collected to keep the external account enabled. If not collected by
* {@code current_deadline}, these fields appear in {@code past_due} as well, and the account is
* disabled.
*/
@SerializedName("currently_due")
List<String> currentlyDue;
/**
* Fields that are {@code currently_due} and need to be collected again because validation or
* verification failed.
*/
@SerializedName("errors")
List<BankAccount.Requirements.Errors> errors;
/**
* Fields that weren't collected by {@code current_deadline}. These fields need to be collected
* to enable the external account.
*/
@SerializedName("past_due")
List<String> pastDue;
/**
* Fields that might become required depending on the results of verification or review. It's an
* empty array unless an asynchronous verification is pending. If verification fails, these
* fields move to {@code eventually_due}, {@code currently_due}, or {@code past_due}. Fields
* might appear in {@code eventually_due}, {@code currently_due}, or {@code past_due} and in
* {@code pending_verification} if verification fails but another verification is still pending.
*/
@SerializedName("pending_verification")
List<String> pendingVerification;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Errors extends StripeObject {
/**
* The code for the type of error.
*
* <p>One of {@code invalid_address_city_state_postal_code}, {@code
* invalid_address_highway_contract_box}, {@code invalid_address_private_mailbox}, {@code
* invalid_business_profile_name}, {@code invalid_business_profile_name_denylisted}, {@code
* invalid_company_name_denylisted}, {@code invalid_dob_age_over_maximum}, {@code
* invalid_dob_age_under_18}, {@code invalid_dob_age_under_minimum}, {@code
* invalid_product_description_length}, {@code invalid_product_description_url_match}, {@code
* invalid_representative_country}, {@code invalid_statement_descriptor_business_mismatch},
* {@code invalid_statement_descriptor_denylisted}, {@code
* invalid_statement_descriptor_length}, {@code
* invalid_statement_descriptor_prefix_denylisted}, {@code
* invalid_statement_descriptor_prefix_mismatch}, {@code invalid_street_address}, {@code
* invalid_tax_id}, {@code invalid_tax_id_format}, {@code invalid_tos_acceptance}, {@code
* invalid_url_denylisted}, {@code invalid_url_format}, {@code invalid_url_length}, {@code
* invalid_url_web_presence_detected}, {@code
* invalid_url_website_business_information_mismatch}, {@code invalid_url_website_empty},
* {@code invalid_url_website_inaccessible}, {@code
* invalid_url_website_inaccessible_geoblocked}, {@code
* invalid_url_website_inaccessible_password_protected}, {@code
* invalid_url_website_incomplete}, {@code
* invalid_url_website_incomplete_cancellation_policy}, {@code
* invalid_url_website_incomplete_customer_service_details}, {@code
* invalid_url_website_incomplete_legal_restrictions}, {@code
* invalid_url_website_incomplete_refund_policy}, {@code
* invalid_url_website_incomplete_return_policy}, {@code
* invalid_url_website_incomplete_terms_and_conditions}, {@code
* invalid_url_website_incomplete_under_construction}, {@code invalid_url_website_other},
* {@code invalid_value_other}, {@code verification_directors_mismatch}, {@code
* verification_document_address_mismatch}, {@code verification_document_address_missing},
* {@code verification_document_corrupt}, {@code verification_document_country_not_supported},
* {@code verification_document_directors_mismatch}, {@code
* verification_document_dob_mismatch}, {@code verification_document_duplicate_type}, {@code
* verification_document_expired}, {@code verification_document_failed_copy}, {@code
* verification_document_failed_greyscale}, {@code verification_document_failed_other}, {@code
* verification_document_failed_test_mode}, {@code verification_document_fraudulent}, {@code
* verification_document_id_number_mismatch}, {@code verification_document_id_number_missing},
* {@code verification_document_incomplete}, {@code verification_document_invalid}, {@code
* verification_document_issue_or_expiry_date_missing}, {@code
* verification_document_manipulated}, {@code verification_document_missing_back}, {@code
* verification_document_missing_front}, {@code verification_document_name_mismatch}, {@code
* verification_document_name_missing}, {@code verification_document_nationality_mismatch},
* {@code verification_document_not_readable}, {@code verification_document_not_signed},
* {@code verification_document_not_uploaded}, {@code verification_document_photo_mismatch},
* {@code verification_document_too_large}, {@code verification_document_type_not_supported},
* {@code verification_extraneous_directors}, {@code verification_failed_address_match},
* {@code verification_failed_business_iec_number}, {@code
* verification_failed_document_match}, {@code verification_failed_id_number_match}, {@code
* verification_failed_keyed_identity}, {@code verification_failed_keyed_match}, {@code
* verification_failed_name_match}, {@code verification_failed_other}, {@code
* verification_failed_representative_authority}, {@code
* verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code
* verification_failed_tax_id_not_issued}, {@code verification_missing_directors}, {@code
* verification_missing_executives}, {@code verification_missing_owners}, or {@code
* verification_requires_additional_memorandum_of_associations}.
*/
@SerializedName("code")
String code;
/**
* An informative message that indicates the error type and provides additional details about
* the error.
*/
@SerializedName("reason")
String reason;
/**
* The specific user onboarding requirement field (in the requirements hash) that needs to be
* resolved.
*/
@SerializedName("requirement")
String requirement;
}
}
@Override
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
trySetResponseGetter(account, responseGetter);
trySetResponseGetter(customer, responseGetter);
trySetResponseGetter(futureRequirements, responseGetter);
trySetResponseGetter(requirements, responseGetter);
}
}