-
Notifications
You must be signed in to change notification settings - Fork 355
/
Account.java
2391 lines (2127 loc) · 93 KB
/
Account.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
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// File generated from our OpenAPI spec
package com.stripe.model;
import com.google.gson.annotations.SerializedName;
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.AccountCapabilitiesParams;
import com.stripe.param.AccountCreateParams;
import com.stripe.param.AccountListParams;
import com.stripe.param.AccountPersonsParams;
import com.stripe.param.AccountRejectParams;
import com.stripe.param.AccountRetrieveParams;
import com.stripe.param.AccountUpdateParams;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
/**
* This is an object representing a Stripe account. You can retrieve it to see properties on the
* account like its current requirements or if the account is enabled to make live charges or
* receive payouts.
*
* <p>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 Custom accounts, the properties below are always returned.
*
* <p>For accounts where <a
* href="https://stripe.com/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a>
* is {@code stripe}, which includes Standard and Express accounts, some properties are only
* returned until you create an <a href="https://stripe.com/api/account_links">Account Link</a> or
* <a href="https://stripe.com/api/account_sessions">Account Session</a> to start Connect
* Onboarding. Learn about the <a href="https://stripe.com/connect/accounts">differences between
* accounts</a>.
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class Account extends ApiResource implements MetadataStore<Account>, PaymentSource {
/** Business information about the account. */
@SerializedName("business_profile")
BusinessProfile businessProfile;
/**
* The business type. After you create an <a href="https://stripe.com/api/account_links">Account
* Link</a> or <a href="https://stripe.com/api/account_sessions">Account Session</a>, this
* property is only returned 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 Custom accounts.
*
* <p>One of {@code company}, {@code government_entity}, {@code individual}, or {@code
* non_profit}.
*/
@SerializedName("business_type")
String businessType;
@SerializedName("capabilities")
Capabilities capabilities;
/** Whether the account can create live charges. */
@SerializedName("charges_enabled")
Boolean chargesEnabled;
@SerializedName("company")
Company company;
@SerializedName("controller")
Controller controller;
/** The account's country. */
@SerializedName("country")
String country;
/** Time at which the account was connected. Measured in seconds since the Unix epoch. */
@SerializedName("created")
Long created;
/**
* Three-letter ISO currency code representing the default currency for the account. This must be
* a currency that <a href="https://stripe.com/docs/payouts">Stripe supports in the account's
* country</a>.
*/
@SerializedName("default_currency")
String defaultCurrency;
/** Always true for a deleted object. */
@SerializedName("deleted")
Boolean deleted;
/**
* Whether account details have been submitted. Accounts with Stripe Dashboard access, which
* includes Standard accounts, cannot receive payouts before this is true.
*/
@SerializedName("details_submitted")
Boolean detailsSubmitted;
/**
* An email address associated with the account. It's not used for authentication and Stripe
* doesn't market to this field without explicit approval from the platform.
*/
@SerializedName("email")
String email;
/**
* External accounts (bank accounts and debit cards) currently attached to this account. External
* accounts are only returned for requests where {@code controller[is_controller]} is true.
*/
@SerializedName("external_accounts")
ExternalAccountCollection externalAccounts;
@SerializedName("future_requirements")
FutureRequirements futureRequirements;
/** Unique identifier for the object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;
/**
* This is an object representing a person associated with a Stripe account.
*
* <p>A platform cannot access a person for an account where <a
* href="https://stripe.com/api/accounts/object#account_object-controller-requirement_collection">account.controller.requirement_collection</a>
* is {@code stripe}, which includes Standard and Express accounts, after creating an Account Link
* or Account Session to start Connect onboarding.
*
* <p>See the <a href="https://stripe.com/connect/standard-accounts">Standard onboarding</a> or <a
* href="https://stripe.com/connect/express-accounts">Express onboarding</a> documentation for
* information about prefilling information and account onboarding steps. Learn more about <a
* href="https://stripe.com/connect/handling-api-verification#person-information">handling
* identity verification with the API</a>.
*/
@SerializedName("individual")
Person individual;
/**
* 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 account}.
*/
@SerializedName("object")
String object;
/** Whether Stripe can send payouts to this account. */
@SerializedName("payouts_enabled")
Boolean payoutsEnabled;
@SerializedName("requirements")
Requirements requirements;
/** Options for customizing how the account functions within Stripe. */
@SerializedName("settings")
Settings settings;
@SerializedName("tos_acceptance")
TosAcceptance tosAcceptance;
/**
* The Stripe account type. Can be {@code standard}, {@code express}, {@code custom}, or {@code
* none}.
*/
@SerializedName("type")
String type;
/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection capabilities() throws StripeException {
return capabilities((Map<String, Object>) null, (RequestOptions) null);
}
/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection capabilities(Map<String, Object> params) throws StripeException {
return capabilities(params, (RequestOptions) null);
}
/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection capabilities(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path =
String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getResponseGetter().request(request, CapabilityCollection.class);
}
/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection capabilities(AccountCapabilitiesParams params)
throws StripeException {
return capabilities(params, (RequestOptions) null);
}
/**
* Returns a list of capabilities associated with the account. The capabilities are returned
* sorted by creation date, with the most recent capability appearing first.
*/
public CapabilityCollection capabilities(AccountCapabilitiesParams params, RequestOptions options)
throws StripeException {
String path =
String.format("/v1/accounts/%s/capabilities", ApiResource.urlEncodeId(this.getId()));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.GET,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getResponseGetter().request(request, CapabilityCollection.class);
}
/**
* With <a href="https://stripe.com/docs/connect">Connect</a>, you can create Stripe accounts for
* your users. To do this, you’ll first need to <a
* href="https://dashboard.stripe.com/account/applications/settings">register your platform</a>.
*
* <p>If you’ve already collected information for your connected accounts, you <a
* href="https://stripe.com/docs/connect/best-practices#onboarding">can prefill that
* information</a> when creating the account. Connect Onboarding won’t ask for the prefilled
* information during account onboarding. You can prefill any information on the account.
*/
public static Account create(Map<String, Object> params) throws StripeException {
return create(params, (RequestOptions) null);
}
/**
* With <a href="https://stripe.com/docs/connect">Connect</a>, you can create Stripe accounts for
* your users. To do this, you’ll first need to <a
* href="https://dashboard.stripe.com/account/applications/settings">register your platform</a>.
*
* <p>If you’ve already collected information for your connected accounts, you <a
* href="https://stripe.com/docs/connect/best-practices#onboarding">can prefill that
* information</a> when creating the account. Connect Onboarding won’t ask for the prefilled
* information during account onboarding. You can prefill any information on the account.
*/
public static Account create(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = "/v1/accounts";
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, Account.class);
}
/**
* With <a href="https://stripe.com/docs/connect">Connect</a>, you can create Stripe accounts for
* your users. To do this, you’ll first need to <a
* href="https://dashboard.stripe.com/account/applications/settings">register your platform</a>.
*
* <p>If you’ve already collected information for your connected accounts, you <a
* href="https://stripe.com/docs/connect/best-practices#onboarding">can prefill that
* information</a> when creating the account. Connect Onboarding won’t ask for the prefilled
* information during account onboarding. You can prefill any information on the account.
*/
public static Account create(AccountCreateParams params) throws StripeException {
return create(params, (RequestOptions) null);
}
/**
* With <a href="https://stripe.com/docs/connect">Connect</a>, you can create Stripe accounts for
* your users. To do this, you’ll first need to <a
* href="https://dashboard.stripe.com/account/applications/settings">register your platform</a>.
*
* <p>If you’ve already collected information for your connected accounts, you <a
* href="https://stripe.com/docs/connect/best-practices#onboarding">can prefill that
* information</a> when creating the account. Connect Onboarding won’t ask for the prefilled
* information during account onboarding. You can prefill any information on the account.
*/
public static Account create(AccountCreateParams params, RequestOptions options)
throws StripeException {
String path = "/v1/accounts";
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getGlobalResponseGetter().request(request, Account.class);
}
/**
* With <a href="https://stripe.com/connect">Connect</a>, you can delete accounts you manage.
*
* <p>Test-mode accounts can be deleted at any time.
*
* <p>Live-mode accounts where Stripe is responsible for negative account balances cannot be
* deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for
* negative account balances, which includes Custom and Express accounts, can be deleted when all
* <a href="https://stripe.com/api/balance/balanace_object">balances</a> are zero.
*
* <p>If you want to delete your own account, use the <a
* href="https://dashboard.stripe.com/settings/account">account information tab in your account
* settings</a> instead.
*/
public Account delete() throws StripeException {
return delete((Map<String, Object>) null, (RequestOptions) null);
}
/**
* With <a href="https://stripe.com/connect">Connect</a>, you can delete accounts you manage.
*
* <p>Test-mode accounts can be deleted at any time.
*
* <p>Live-mode accounts where Stripe is responsible for negative account balances cannot be
* deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for
* negative account balances, which includes Custom and Express accounts, can be deleted when all
* <a href="https://stripe.com/api/balance/balanace_object">balances</a> are zero.
*
* <p>If you want to delete your own account, use the <a
* href="https://dashboard.stripe.com/settings/account">account information tab in your account
* settings</a> instead.
*/
public Account delete(RequestOptions options) throws StripeException {
return delete((Map<String, Object>) null, options);
}
/**
* With <a href="https://stripe.com/connect">Connect</a>, you can delete accounts you manage.
*
* <p>Test-mode accounts can be deleted at any time.
*
* <p>Live-mode accounts where Stripe is responsible for negative account balances cannot be
* deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for
* negative account balances, which includes Custom and Express accounts, can be deleted when all
* <a href="https://stripe.com/api/balance/balanace_object">balances</a> are zero.
*
* <p>If you want to delete your own account, use the <a
* href="https://dashboard.stripe.com/settings/account">account information tab in your account
* settings</a> instead.
*/
public Account delete(Map<String, Object> params) throws StripeException {
return delete(params, (RequestOptions) null);
}
/**
* With <a href="https://stripe.com/connect">Connect</a>, you can delete accounts you manage.
*
* <p>Test-mode accounts can be deleted at any time.
*
* <p>Live-mode accounts where Stripe is responsible for negative account balances cannot be
* deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for
* negative account balances, which includes Custom and Express accounts, can be deleted when all
* <a href="https://stripe.com/api/balance/balanace_object">balances</a> are zero.
*
* <p>If you want to delete your own account, use the <a
* href="https://dashboard.stripe.com/settings/account">account information tab in your account
* settings</a> instead.
*/
public Account delete(Map<String, Object> params, RequestOptions options) throws StripeException {
String path = String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.DELETE, path, params, options, ApiMode.V1);
return getResponseGetter().request(request, Account.class);
}
/**
* Returns a list of accounts connected to your platform via <a
* href="https://stripe.com/docs/connect">Connect</a>. If you’re not a platform, the list is
* empty.
*/
public static AccountCollection list(Map<String, Object> params) throws StripeException {
return list(params, (RequestOptions) null);
}
/**
* Returns a list of accounts connected to your platform via <a
* href="https://stripe.com/docs/connect">Connect</a>. If you’re not a platform, the list is
* empty.
*/
public static AccountCollection list(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = "/v1/accounts";
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, AccountCollection.class);
}
/**
* Returns a list of accounts connected to your platform via <a
* href="https://stripe.com/docs/connect">Connect</a>. If you’re not a platform, the list is
* empty.
*/
public static AccountCollection list(AccountListParams params) throws StripeException {
return list(params, (RequestOptions) null);
}
/**
* Returns a list of accounts connected to your platform via <a
* href="https://stripe.com/docs/connect">Connect</a>. If you’re not a platform, the list is
* empty.
*/
public static AccountCollection list(AccountListParams params, RequestOptions options)
throws StripeException {
String path = "/v1/accounts";
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.GET,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getGlobalResponseGetter().request(request, AccountCollection.class);
}
/**
* Returns a list of people associated with the account’s legal entity. The people are returned
* sorted by creation date, with the most recent people appearing first.
*/
public PersonCollection persons() throws StripeException {
return persons((Map<String, Object>) null, (RequestOptions) null);
}
/**
* Returns a list of people associated with the account’s legal entity. The people are returned
* sorted by creation date, with the most recent people appearing first.
*/
public PersonCollection persons(Map<String, Object> params) throws StripeException {
return persons(params, (RequestOptions) null);
}
/**
* Returns a list of people associated with the account’s legal entity. The people are returned
* sorted by creation date, with the most recent people appearing first.
*/
public PersonCollection persons(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = String.format("/v1/accounts/%s/persons", ApiResource.urlEncodeId(this.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getResponseGetter().request(request, PersonCollection.class);
}
/**
* Returns a list of people associated with the account’s legal entity. The people are returned
* sorted by creation date, with the most recent people appearing first.
*/
public PersonCollection persons(AccountPersonsParams params) throws StripeException {
return persons(params, (RequestOptions) null);
}
/**
* Returns a list of people associated with the account’s legal entity. The people are returned
* sorted by creation date, with the most recent people appearing first.
*/
public PersonCollection persons(AccountPersonsParams params, RequestOptions options)
throws StripeException {
String path = String.format("/v1/accounts/%s/persons", ApiResource.urlEncodeId(this.getId()));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.GET,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getResponseGetter().request(request, PersonCollection.class);
}
/**
* With <a href="https://stripe.com/connect">Connect</a>, you can reject accounts that you have
* flagged as suspicious.
*
* <p>Only accounts where your platform is liable for negative account balances, which includes
* Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time.
* Live-mode accounts can only be rejected after all balances are zero.
*/
public Account reject(Map<String, Object> params) throws StripeException {
return reject(params, (RequestOptions) null);
}
/**
* With <a href="https://stripe.com/connect">Connect</a>, you can reject accounts that you have
* flagged as suspicious.
*
* <p>Only accounts where your platform is liable for negative account balances, which includes
* Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time.
* Live-mode accounts can only be rejected after all balances are zero.
*/
public Account reject(Map<String, Object> params, RequestOptions options) throws StripeException {
String path = String.format("/v1/accounts/%s/reject", ApiResource.urlEncodeId(this.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return getResponseGetter().request(request, Account.class);
}
/**
* With <a href="https://stripe.com/connect">Connect</a>, you can reject accounts that you have
* flagged as suspicious.
*
* <p>Only accounts where your platform is liable for negative account balances, which includes
* Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time.
* Live-mode accounts can only be rejected after all balances are zero.
*/
public Account reject(AccountRejectParams params) throws StripeException {
return reject(params, (RequestOptions) null);
}
/**
* With <a href="https://stripe.com/connect">Connect</a>, you can reject accounts that you have
* flagged as suspicious.
*
* <p>Only accounts where your platform is liable for negative account balances, which includes
* Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time.
* Live-mode accounts can only be rejected after all balances are zero.
*/
public Account reject(AccountRejectParams params, RequestOptions options) throws StripeException {
String path = String.format("/v1/accounts/%s/reject", 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, Account.class);
}
/** Retrieves the details of an account. */
public static Account retrieve(String account) throws StripeException {
return retrieve(account, (Map<String, Object>) null, (RequestOptions) null);
}
/** Retrieves the details of an account. */
public static Account retrieve(String account, RequestOptions options) throws StripeException {
return retrieve(account, (Map<String, Object>) null, options);
}
/** Retrieves the details of an account. */
public static Account retrieve(String account, Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, Account.class);
}
/** Retrieves the details of an account. */
public static Account retrieve(
String account, AccountRetrieveParams params, RequestOptions options) throws StripeException {
String path = String.format("/v1/accounts/%s", ApiResource.urlEncodeId(account));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.GET,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getGlobalResponseGetter().request(request, Account.class);
}
/** Retrieves the details of an account. */
public static Account retrieve() throws StripeException {
return retrieve((Map<String, Object>) null, (RequestOptions) null);
}
/** Retrieves the details of an account. */
public static Account retrieve(RequestOptions options) throws StripeException {
return retrieve((Map<String, Object>) null, options);
}
/** Retrieves the details of an account. */
public static Account retrieve(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = "/v1/account";
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, Account.class);
}
/** Retrieves the details of an account. */
public static Account retrieve(AccountRetrieveParams params, RequestOptions options)
throws StripeException {
String path = "/v1/account";
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.GET,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getGlobalResponseGetter().request(request, Account.class);
}
/**
* Updates a <a href="https://stripe.com/connect/accounts">connected account</a> by setting the
* values of the parameters passed. Any parameters not provided are left unchanged.
*
* <p>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 Custom accounts, you can update any information on the
* account.
*
* <p>For accounts where <a
* href="https://stripe.com/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a>
* is {@code stripe}, which includes Standard and Express accounts, you can update all information
* until you create an <a href="https://stripe.com/api/account_links">Account Link</a> or <a
* href="https://stripe.com/api/account_sessions">Account Session</a> to start Connect onboarding,
* after which some properties can no longer be updated.
*
* <p>To update your own account, use the <a
* href="https://dashboard.stripe.com/settings/account">Dashboard</a>. Refer to our <a
* href="https://stripe.com/docs/connect/updating-accounts">Connect</a> documentation to learn
* more about updating accounts.
*/
@Override
public Account update(Map<String, Object> params) throws StripeException {
return update(params, (RequestOptions) null);
}
/**
* Updates a <a href="https://stripe.com/connect/accounts">connected account</a> by setting the
* values of the parameters passed. Any parameters not provided are left unchanged.
*
* <p>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 Custom accounts, you can update any information on the
* account.
*
* <p>For accounts where <a
* href="https://stripe.com/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a>
* is {@code stripe}, which includes Standard and Express accounts, you can update all information
* until you create an <a href="https://stripe.com/api/account_links">Account Link</a> or <a
* href="https://stripe.com/api/account_sessions">Account Session</a> to start Connect onboarding,
* after which some properties can no longer be updated.
*
* <p>To update your own account, use the <a
* href="https://dashboard.stripe.com/settings/account">Dashboard</a>. Refer to our <a
* href="https://stripe.com/docs/connect/updating-accounts">Connect</a> documentation to learn
* more about updating accounts.
*/
@Override
public Account update(Map<String, Object> params, RequestOptions options) throws StripeException {
String path = String.format("/v1/accounts/%s", ApiResource.urlEncodeId(this.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return getResponseGetter().request(request, Account.class);
}
/**
* Updates a <a href="https://stripe.com/connect/accounts">connected account</a> by setting the
* values of the parameters passed. Any parameters not provided are left unchanged.
*
* <p>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 Custom accounts, you can update any information on the
* account.
*
* <p>For accounts where <a
* href="https://stripe.com/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a>
* is {@code stripe}, which includes Standard and Express accounts, you can update all information
* until you create an <a href="https://stripe.com/api/account_links">Account Link</a> or <a
* href="https://stripe.com/api/account_sessions">Account Session</a> to start Connect onboarding,
* after which some properties can no longer be updated.
*
* <p>To update your own account, use the <a
* href="https://dashboard.stripe.com/settings/account">Dashboard</a>. Refer to our <a
* href="https://stripe.com/docs/connect/updating-accounts">Connect</a> documentation to learn
* more about updating accounts.
*/
public Account update(AccountUpdateParams params) throws StripeException {
return update(params, (RequestOptions) null);
}
/**
* Updates a <a href="https://stripe.com/connect/accounts">connected account</a> by setting the
* values of the parameters passed. Any parameters not provided are left unchanged.
*
* <p>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 Custom accounts, you can update any information on the
* account.
*
* <p>For accounts where <a
* href="https://stripe.com/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a>
* is {@code stripe}, which includes Standard and Express accounts, you can update all information
* until you create an <a href="https://stripe.com/api/account_links">Account Link</a> or <a
* href="https://stripe.com/api/account_sessions">Account Session</a> to start Connect onboarding,
* after which some properties can no longer be updated.
*
* <p>To update your own account, use the <a
* href="https://dashboard.stripe.com/settings/account">Dashboard</a>. Refer to our <a
* href="https://stripe.com/docs/connect/updating-accounts">Connect</a> documentation to learn
* more about updating accounts.
*/
public Account update(AccountUpdateParams params, RequestOptions options) throws StripeException {
String path = String.format("/v1/accounts/%s", 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, Account.class);
}
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class BusinessProfile extends StripeObject {
/** The applicant's gross annual revenue for its preceding fiscal year. */
@SerializedName("annual_revenue")
AnnualRevenue annualRevenue;
/**
* An estimated upper bound of employees, contractors, vendors, etc. currently working for the
* business.
*/
@SerializedName("estimated_worker_count")
Long estimatedWorkerCount;
/**
* <a href="https://stripe.com/docs/connect/setting-mcc">The merchant category code for the
* account</a>. MCCs are used to classify businesses based on the goods or services they
* provide.
*/
@SerializedName("mcc")
String mcc;
@SerializedName("monthly_estimated_revenue")
MonthlyEstimatedRevenue monthlyEstimatedRevenue;
/** The customer-facing business name. */
@SerializedName("name")
String name;
/**
* Internal-only description of the product sold or service provided by the business. It's used
* by Stripe for risk and underwriting purposes.
*/
@SerializedName("product_description")
String productDescription;
/** A publicly available mailing address for sending support issues to. */
@SerializedName("support_address")
Address supportAddress;
/** A publicly available email address for sending support issues to. */
@SerializedName("support_email")
String supportEmail;
/** A publicly available phone number to call with support issues. */
@SerializedName("support_phone")
String supportPhone;
/** A publicly available website for handling support issues. */
@SerializedName("support_url")
String supportUrl;
/** The business's publicly available website. */
@SerializedName("url")
String url;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class AnnualRevenue extends StripeObject {
/**
* A non-negative integer representing the amount in the <a
* href="https://docs.stripe.com/currencies#zero-decimal">smallest currency unit</a>.
*/
@SerializedName("amount")
Long amount;
/**
* Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
* code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
* currency</a>.
*/
@SerializedName("currency")
String currency;
/**
* The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the
* 31st of December, 2023.
*/
@SerializedName("fiscal_year_end")
String fiscalYearEnd;
}
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class MonthlyEstimatedRevenue extends StripeObject {
/**
* A non-negative integer representing how much to charge in the <a
* href="https://docs.stripe.com/currencies#zero-decimal">smallest currency unit</a>.
*/
@SerializedName("amount")
Long amount;
/**
* Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
* code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
* currency</a>.
*/
@SerializedName("currency")
String currency;
}
}
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Capabilities extends StripeObject {
/**
* The status of the Canadian pre-authorized debits payments capability of the account, or
* whether the account can directly process Canadian pre-authorized debits charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("acss_debit_payments")
String acssDebitPayments;
/**
* The status of the Affirm capability of the account, or whether the account can directly
* process Affirm charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("affirm_payments")
String affirmPayments;
/**
* The status of the Afterpay Clearpay capability of the account, or whether the account can
* directly process Afterpay Clearpay charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("afterpay_clearpay_payments")
String afterpayClearpayPayments;
/**
* The status of the AmazonPay capability of the account, or whether the account can directly
* process AmazonPay payments.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("amazon_pay_payments")
String amazonPayPayments;
/**
* The status of the BECS Direct Debit (AU) payments capability of the account, or whether the
* account can directly process BECS Direct Debit (AU) charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("au_becs_debit_payments")
String auBecsDebitPayments;
/**
* The status of the Bacs Direct Debits payments capability of the account, or whether the
* account can directly process Bacs Direct Debits charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("bacs_debit_payments")
String bacsDebitPayments;
/**
* The status of the Bancontact payments capability of the account, or whether the account can
* directly process Bancontact charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("bancontact_payments")
String bancontactPayments;
/**
* The status of the customer_balance payments capability of the account, or whether the account
* can directly process customer_balance charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("bank_transfer_payments")
String bankTransferPayments;
/**
* The status of the blik payments capability of the account, or whether the account can
* directly process blik charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("blik_payments")
String blikPayments;
/**
* The status of the boleto payments capability of the account, or whether the account can
* directly process boleto charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("boleto_payments")
String boletoPayments;
/**
* The status of the card issuing capability of the account, or whether you can use Issuing to
* distribute funds on cards
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("card_issuing")
String cardIssuing;
/**
* The status of the card payments capability of the account, or whether the account can
* directly process credit and debit card charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("card_payments")
String cardPayments;
/**
* The status of the Cartes Bancaires payments capability of the account, or whether the account
* can directly process Cartes Bancaires card charges in EUR currency.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("cartes_bancaires_payments")
String cartesBancairesPayments;
/**
* The status of the Cash App Pay capability of the account, or whether the account can directly
* process Cash App Pay payments.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("cashapp_payments")
String cashappPayments;
/**
* The status of the EPS payments capability of the account, or whether the account can directly
* process EPS charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("eps_payments")
String epsPayments;
/**
* The status of the FPX payments capability of the account, or whether the account can directly
* process FPX charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("fpx_payments")
String fpxPayments;
/**