-
Notifications
You must be signed in to change notification settings - Fork 397
Expand file tree
/
Copy pathStripeClient.java
More file actions
1540 lines (1383 loc) · 66 KB
/
StripeClient.java
File metadata and controls
1540 lines (1383 loc) · 66 KB
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
package com.stripe;
import com.stripe.exception.SignatureVerificationException;
import com.stripe.exception.StripeException;
import com.stripe.model.StripeObject;
import com.stripe.model.v2.core.EventNotification;
import com.stripe.net.*;
import com.stripe.net.Webhook.Signature;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import lombok.Builder;
import lombok.Getter;
/**
* This is the primary entrypoint to make requests against Stripe's API. It provides a means of
* accessing all the methods on the Stripe API, and the ability to set configuration such as apiKey
* and connection timeouts.
*/
public class StripeClient {
private final StripeResponseGetter responseGetter;
/**
* Constructs a StripeClient with default settings, using the provided API key. Use the builder
* instead if you require more complex configuration.
*/
public StripeClient(String apiKey) {
this.responseGetter =
new LiveStripeResponseGetter(builder().setApiKey(apiKey).buildOptions(), null);
}
/**
* Constructs a StripeClient with a custom StripeResponseGetter.
*
* <p>Use this for testing, or advanced use cases where you need to make fundamental changes to
* how the StripeClient makes requests.
*/
public StripeClient(StripeResponseGetter responseGetter) {
this.responseGetter = responseGetter;
}
protected StripeResponseGetter getResponseGetter() {
return responseGetter;
}
/** Gets the current StripeContext from the client's configuration. Used in unit testing. */
protected String getContext() {
// TODO(major): add getOptions to the StripeResponseGetter interface? that would simplify this
if (!(responseGetter instanceof LiveStripeResponseGetter)) {
return null;
}
LiveStripeResponseGetter liveGetter = (LiveStripeResponseGetter) responseGetter;
StripeResponseGetterOptions options = liveGetter.getOptions();
return options.getStripeContext();
}
/**
* Creates a new StripeClient with the same configuration as this client but with a custom
* StripeContext. This method is useful for creating thread-safe clients with different contexts,
* such as when processing webhooks in parallel where each webhook has its own context.
*
* <p>The new client will share the same configuration (API key, timeouts, proxy settings, etc.)
* and HTTP client as this client, but will have the specified context. This allows for efficient
* parallel processing without reinitializing HTTP connections.
*
* @param context the custom stripe_context to use for the new client
* @return a new StripeClient with the custom context
* @throws IllegalStateException if this client doesn't use a LiveStripeResponseGetter
*/
public StripeClient withStripeContext(StripeContext context) {
// Convert StripeContext to String
String contextString = (context == null) ? null : context.toString();
StripeResponseGetter responseGetter = this.getResponseGetter();
// We can only create a new client for LiveStripeResponseGetter because it's the only class with
// `getOptions()`. If we add that method to the interface in a later major, we could remove this
// check.
if (!(responseGetter instanceof LiveStripeResponseGetter)) {
throw new IllegalStateException(
"Cannot create a client with custom context for non-Live response getters");
}
LiveStripeResponseGetter liveGetter = (LiveStripeResponseGetter) responseGetter;
// Create a new LiveStripeResponseGetter with updated context, reusing the HTTP client
LiveStripeResponseGetter newResponseGetter =
liveGetter.withNewOptions(
options -> {
ClientStripeResponseGetterOptions existingOptions =
(ClientStripeResponseGetterOptions) options;
return existingOptions.toBuilder().stripeContext(contextString).build();
});
// Create and return a new StripeClient with the new response getter
return new StripeClient(newResponseGetter);
}
/**
* Returns an StripeEvent instance using the provided JSON payload. Throws a JsonSyntaxException
* if the payload is not valid JSON, and a SignatureVerificationException if the signature
* verification fails for any reason.
*
* @param payload the payload sent by Stripe.
* @param sigHeader the contents of the signature header sent by Stripe.
* @param secret secret used to generate the signature.
* @return the StripeEvent instance
* @throws SignatureVerificationException if the verification fails.
*/
public EventNotification parseEventNotification(String payload, String sigHeader, String secret)
throws SignatureVerificationException {
return parseEventNotification(payload, sigHeader, secret, Webhook.DEFAULT_TOLERANCE);
}
/**
* Returns an StripeEvent instance using the provided JSON payload. Throws a JsonSyntaxException
* if the payload is not valid JSON, and a SignatureVerificationException if the signature
* verification fails for any reason.
*
* @param payload the payload sent by Stripe.
* @param sigHeader the contents of the signature header sent by Stripe.
* @param secret secret used to generate the signature.
* @param tolerance number of seconds that the event's timestamp can differ from the system time.
* Passing `0` will disable the time check entirely and is **strongly discouraged**.
* @return the StripeEvent instance
* @throws SignatureVerificationException if the verification fails.
*/
public EventNotification parseEventNotification(
String payload, String sigHeader, String secret, long tolerance)
throws SignatureVerificationException {
Signature.verifyHeader(payload, sigHeader, secret, tolerance);
return EventNotification.fromJson(payload, this);
}
/**
* Returns an Event instance using the provided JSON payload. Throws a JsonSyntaxException if the
* payload is not valid JSON, and a SignatureVerificationException if the signature verification
* fails for any reason.
*
* @param payload the payload sent by Stripe.
* @param sigHeader the contents of the signature header sent by Stripe.
* @param secret secret used to generate the signature.
* @return the Event instance
* @throws SignatureVerificationException if the verification fails.
*/
public com.stripe.model.Event constructEvent(String payload, String sigHeader, String secret)
throws SignatureVerificationException {
com.stripe.model.Event event = Webhook.constructEvent(payload, sigHeader, secret);
event.setResponseGetter(this.getResponseGetter());
return event;
}
/**
* Returns an Event instance using the provided JSON payload. Throws a JsonSyntaxException if the
* payload is not valid JSON, and a SignatureVerificationException if the signature verification
* fails for any reason.
*
* @param payload the payload sent by Stripe.
* @param sigHeader the contents of the signature header sent by Stripe.
* @param secret secret used to generate the signature.
* @param tolerance maximum difference in seconds allowed between the header's timestamp and the
* current time
* @return the Event instance
* @throws SignatureVerificationException if the verification fails.
*/
public com.stripe.model.Event constructEvent(
String payload, String sigHeader, String secret, long tolerance)
throws SignatureVerificationException {
com.stripe.model.Event event = Webhook.constructEvent(payload, sigHeader, secret, tolerance);
event.setResponseGetter(this.getResponseGetter());
return event;
}
// The beginning of the section generated from our OpenAPI spec
public com.stripe.service.V1Services v1() {
return new com.stripe.service.V1Services(this.getResponseGetter());
}
public com.stripe.service.V2Services v2() {
return new com.stripe.service.V2Services(this.getResponseGetter());
}
/**
* @deprecated StripeClient.accountLinks() is deprecated, use StripeClient.v1().accountLinks()
* instead. All functionality under it has been copied over to
* StripeClient.v1().accountLinks(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.AccountLinkService accountLinks() {
return new com.stripe.service.AccountLinkService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.accountNotices() is deprecated, use StripeClient.v1().accountNotices()
* instead. All functionality under it has been copied over to
* StripeClient.v1().accountNotices(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.AccountNoticeService accountNotices() {
return new com.stripe.service.AccountNoticeService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.accountSessions() is deprecated, use
* StripeClient.v1().accountSessions() instead. All functionality under it has been copied
* over to StripeClient.v1().accountSessions(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.AccountSessionService accountSessions() {
return new com.stripe.service.AccountSessionService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.accounts() is deprecated, use StripeClient.v1().accounts() instead.
* All functionality under it has been copied over to StripeClient.v1().accounts(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.AccountService accounts() {
return new com.stripe.service.AccountService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.applePayDomains() is deprecated, use
* StripeClient.v1().applePayDomains() instead. All functionality under it has been copied
* over to StripeClient.v1().applePayDomains(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ApplePayDomainService applePayDomains() {
return new com.stripe.service.ApplePayDomainService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.applicationFees() is deprecated, use
* StripeClient.v1().applicationFees() instead. All functionality under it has been copied
* over to StripeClient.v1().applicationFees(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ApplicationFeeService applicationFees() {
return new com.stripe.service.ApplicationFeeService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.apps() is deprecated, use StripeClient.v1().apps() instead. All
* functionality under it has been copied over to StripeClient.v1().apps(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.AppsService apps() {
return new com.stripe.service.AppsService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.balance() is deprecated, use StripeClient.v1().balance() instead. All
* functionality under it has been copied over to StripeClient.v1().balance(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.BalanceService balance() {
return new com.stripe.service.BalanceService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.balanceSettings() is deprecated, use
* StripeClient.v1().balanceSettings() instead. All functionality under it has been copied
* over to StripeClient.v1().balanceSettings(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.BalanceSettingsService balanceSettings() {
return new com.stripe.service.BalanceSettingsService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.balanceTransactions() is deprecated, use
* StripeClient.v1().balanceTransactions() instead. All functionality under it has been copied
* over to StripeClient.v1().balanceTransactions(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.BalanceTransactionService balanceTransactions() {
return new com.stripe.service.BalanceTransactionService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.billing() is deprecated, use StripeClient.v1().billing() instead. All
* functionality under it has been copied over to StripeClient.v1().billing(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.BillingService billing() {
return new com.stripe.service.BillingService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.billingPortal() is deprecated, use StripeClient.v1().billingPortal()
* instead. All functionality under it has been copied over to
* StripeClient.v1().billingPortal(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.BillingPortalService billingPortal() {
return new com.stripe.service.BillingPortalService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.capital() is deprecated, use StripeClient.v1().capital() instead. All
* functionality under it has been copied over to StripeClient.v1().capital(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.CapitalService capital() {
return new com.stripe.service.CapitalService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.charges() is deprecated, use StripeClient.v1().charges() instead. All
* functionality under it has been copied over to StripeClient.v1().charges(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ChargeService charges() {
return new com.stripe.service.ChargeService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.checkout() is deprecated, use StripeClient.v1().checkout() instead.
* All functionality under it has been copied over to StripeClient.v1().checkout(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.CheckoutService checkout() {
return new com.stripe.service.CheckoutService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.climate() is deprecated, use StripeClient.v1().climate() instead. All
* functionality under it has been copied over to StripeClient.v1().climate(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ClimateService climate() {
return new com.stripe.service.ClimateService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.confirmationTokens() is deprecated, use
* StripeClient.v1().confirmationTokens() instead. All functionality under it has been copied
* over to StripeClient.v1().confirmationTokens(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ConfirmationTokenService confirmationTokens() {
return new com.stripe.service.ConfirmationTokenService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.countrySpecs() is deprecated, use StripeClient.v1().countrySpecs()
* instead. All functionality under it has been copied over to
* StripeClient.v1().countrySpecs(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.CountrySpecService countrySpecs() {
return new com.stripe.service.CountrySpecService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.coupons() is deprecated, use StripeClient.v1().coupons() instead. All
* functionality under it has been copied over to StripeClient.v1().coupons(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.CouponService coupons() {
return new com.stripe.service.CouponService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.creditNotes() is deprecated, use StripeClient.v1().creditNotes()
* instead. All functionality under it has been copied over to
* StripeClient.v1().creditNotes(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.CreditNoteService creditNotes() {
return new com.stripe.service.CreditNoteService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.customerSessions() is deprecated, use
* StripeClient.v1().customerSessions() instead. All functionality under it has been copied
* over to StripeClient.v1().customerSessions(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.CustomerSessionService customerSessions() {
return new com.stripe.service.CustomerSessionService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.customers() is deprecated, use StripeClient.v1().customers() instead.
* All functionality under it has been copied over to StripeClient.v1().customers(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.CustomerService customers() {
return new com.stripe.service.CustomerService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.disputes() is deprecated, use StripeClient.v1().disputes() instead.
* All functionality under it has been copied over to StripeClient.v1().disputes(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.DisputeService disputes() {
return new com.stripe.service.DisputeService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.entitlements() is deprecated, use StripeClient.v1().entitlements()
* instead. All functionality under it has been copied over to
* StripeClient.v1().entitlements(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.EntitlementsService entitlements() {
return new com.stripe.service.EntitlementsService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.ephemeralKeys() is deprecated, use StripeClient.v1().ephemeralKeys()
* instead. All functionality under it has been copied over to
* StripeClient.v1().ephemeralKeys(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.EphemeralKeyService ephemeralKeys() {
return new com.stripe.service.EphemeralKeyService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.events() is deprecated, use StripeClient.v1().events() instead. All
* functionality under it has been copied over to StripeClient.v1().events(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.EventService events() {
return new com.stripe.service.EventService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.exchangeRates() is deprecated, use StripeClient.v1().exchangeRates()
* instead. All functionality under it has been copied over to
* StripeClient.v1().exchangeRates(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ExchangeRateService exchangeRates() {
return new com.stripe.service.ExchangeRateService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.externalAccounts() is deprecated, use
* StripeClient.v1().externalAccounts() instead. All functionality under it has been copied
* over to StripeClient.v1().externalAccounts(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ExternalAccountService externalAccounts() {
return new com.stripe.service.ExternalAccountService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.fileLinks() is deprecated, use StripeClient.v1().fileLinks() instead.
* All functionality under it has been copied over to StripeClient.v1().fileLinks(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.FileLinkService fileLinks() {
return new com.stripe.service.FileLinkService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.files() is deprecated, use StripeClient.v1().files() instead. All
* functionality under it has been copied over to StripeClient.v1().files(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.FileService files() {
return new com.stripe.service.FileService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.financialConnections() is deprecated, use
* StripeClient.v1().financialConnections() instead. All functionality under it has been
* copied over to StripeClient.v1().financialConnections(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.FinancialConnectionsService financialConnections() {
return new com.stripe.service.FinancialConnectionsService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.forwarding() is deprecated, use StripeClient.v1().forwarding()
* instead. All functionality under it has been copied over to StripeClient.v1().forwarding().
* See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ForwardingService forwarding() {
return new com.stripe.service.ForwardingService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.fxQuotes() is deprecated, use StripeClient.v1().fxQuotes() instead.
* All functionality under it has been copied over to StripeClient.v1().fxQuotes(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.FxQuoteService fxQuotes() {
return new com.stripe.service.FxQuoteService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.identity() is deprecated, use StripeClient.v1().identity() instead.
* All functionality under it has been copied over to StripeClient.v1().identity(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.IdentityService identity() {
return new com.stripe.service.IdentityService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.invoiceItems() is deprecated, use StripeClient.v1().invoiceItems()
* instead. All functionality under it has been copied over to
* StripeClient.v1().invoiceItems(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.InvoiceItemService invoiceItems() {
return new com.stripe.service.InvoiceItemService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.invoicePayments() is deprecated, use
* StripeClient.v1().invoicePayments() instead. All functionality under it has been copied
* over to StripeClient.v1().invoicePayments(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.InvoicePaymentService invoicePayments() {
return new com.stripe.service.InvoicePaymentService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.invoiceRenderingTemplates() is deprecated, use
* StripeClient.v1().invoiceRenderingTemplates() instead. All functionality under it has been
* copied over to StripeClient.v1().invoiceRenderingTemplates(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.InvoiceRenderingTemplateService invoiceRenderingTemplates() {
return new com.stripe.service.InvoiceRenderingTemplateService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.invoices() is deprecated, use StripeClient.v1().invoices() instead.
* All functionality under it has been copied over to StripeClient.v1().invoices(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.InvoiceService invoices() {
return new com.stripe.service.InvoiceService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.issuing() is deprecated, use StripeClient.v1().issuing() instead. All
* functionality under it has been copied over to StripeClient.v1().issuing(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.IssuingService issuing() {
return new com.stripe.service.IssuingService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.mandates() is deprecated, use StripeClient.v1().mandates() instead.
* All functionality under it has been copied over to StripeClient.v1().mandates(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.MandateService mandates() {
return new com.stripe.service.MandateService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.margins() is deprecated, use StripeClient.v1().margins() instead. All
* functionality under it has been copied over to StripeClient.v1().margins(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.MarginService margins() {
return new com.stripe.service.MarginService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.orders() is deprecated, use StripeClient.v1().orders() instead. All
* functionality under it has been copied over to StripeClient.v1().orders(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.OrderService orders() {
return new com.stripe.service.OrderService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.paymentAttemptRecords() is deprecated, use
* StripeClient.v1().paymentAttemptRecords() instead. All functionality under it has been
* copied over to StripeClient.v1().paymentAttemptRecords(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PaymentAttemptRecordService paymentAttemptRecords() {
return new com.stripe.service.PaymentAttemptRecordService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.paymentIntents() is deprecated, use StripeClient.v1().paymentIntents()
* instead. All functionality under it has been copied over to
* StripeClient.v1().paymentIntents(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PaymentIntentService paymentIntents() {
return new com.stripe.service.PaymentIntentService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.paymentLinks() is deprecated, use StripeClient.v1().paymentLinks()
* instead. All functionality under it has been copied over to
* StripeClient.v1().paymentLinks(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PaymentLinkService paymentLinks() {
return new com.stripe.service.PaymentLinkService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.paymentMethodConfigurations() is deprecated, use
* StripeClient.v1().paymentMethodConfigurations() instead. All functionality under it has
* been copied over to StripeClient.v1().paymentMethodConfigurations(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PaymentMethodConfigurationService paymentMethodConfigurations() {
return new com.stripe.service.PaymentMethodConfigurationService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.paymentMethodDomains() is deprecated, use
* StripeClient.v1().paymentMethodDomains() instead. All functionality under it has been
* copied over to StripeClient.v1().paymentMethodDomains(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PaymentMethodDomainService paymentMethodDomains() {
return new com.stripe.service.PaymentMethodDomainService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.paymentMethods() is deprecated, use StripeClient.v1().paymentMethods()
* instead. All functionality under it has been copied over to
* StripeClient.v1().paymentMethods(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PaymentMethodService paymentMethods() {
return new com.stripe.service.PaymentMethodService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.paymentRecords() is deprecated, use StripeClient.v1().paymentRecords()
* instead. All functionality under it has been copied over to
* StripeClient.v1().paymentRecords(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PaymentRecordService paymentRecords() {
return new com.stripe.service.PaymentRecordService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.payouts() is deprecated, use StripeClient.v1().payouts() instead. All
* functionality under it has been copied over to StripeClient.v1().payouts(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PayoutService payouts() {
return new com.stripe.service.PayoutService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.plans() is deprecated, use StripeClient.v1().plans() instead. All
* functionality under it has been copied over to StripeClient.v1().plans(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PlanService plans() {
return new com.stripe.service.PlanService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.prices() is deprecated, use StripeClient.v1().prices() instead. All
* functionality under it has been copied over to StripeClient.v1().prices(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PriceService prices() {
return new com.stripe.service.PriceService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.privacy() is deprecated, use StripeClient.v1().privacy() instead. All
* functionality under it has been copied over to StripeClient.v1().privacy(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PrivacyService privacy() {
return new com.stripe.service.PrivacyService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.productCatalog() is deprecated, use StripeClient.v1().productCatalog()
* instead. All functionality under it has been copied over to
* StripeClient.v1().productCatalog(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ProductCatalogService productCatalog() {
return new com.stripe.service.ProductCatalogService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.products() is deprecated, use StripeClient.v1().products() instead.
* All functionality under it has been copied over to StripeClient.v1().products(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ProductService products() {
return new com.stripe.service.ProductService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.promotionCodes() is deprecated, use StripeClient.v1().promotionCodes()
* instead. All functionality under it has been copied over to
* StripeClient.v1().promotionCodes(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PromotionCodeService promotionCodes() {
return new com.stripe.service.PromotionCodeService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.quotes() is deprecated, use StripeClient.v1().quotes() instead. All
* functionality under it has been copied over to StripeClient.v1().quotes(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.QuoteService quotes() {
return new com.stripe.service.QuoteService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.radar() is deprecated, use StripeClient.v1().radar() instead. All
* functionality under it has been copied over to StripeClient.v1().radar(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.RadarService radar() {
return new com.stripe.service.RadarService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.refunds() is deprecated, use StripeClient.v1().refunds() instead. All
* functionality under it has been copied over to StripeClient.v1().refunds(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.RefundService refunds() {
return new com.stripe.service.RefundService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.reporting() is deprecated, use StripeClient.v1().reporting() instead.
* All functionality under it has been copied over to StripeClient.v1().reporting(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ReportingService reporting() {
return new com.stripe.service.ReportingService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.reserve() is deprecated, use StripeClient.v1().reserve() instead. All
* functionality under it has been copied over to StripeClient.v1().reserve(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ReserveService reserve() {
return new com.stripe.service.ReserveService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.reviews() is deprecated, use StripeClient.v1().reviews() instead. All
* functionality under it has been copied over to StripeClient.v1().reviews(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ReviewService reviews() {
return new com.stripe.service.ReviewService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.setupAttempts() is deprecated, use StripeClient.v1().setupAttempts()
* instead. All functionality under it has been copied over to
* StripeClient.v1().setupAttempts(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.SetupAttemptService setupAttempts() {
return new com.stripe.service.SetupAttemptService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.setupIntents() is deprecated, use StripeClient.v1().setupIntents()
* instead. All functionality under it has been copied over to
* StripeClient.v1().setupIntents(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.SetupIntentService setupIntents() {
return new com.stripe.service.SetupIntentService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.sharedPayment() is deprecated, use StripeClient.v1().sharedPayment()
* instead. All functionality under it has been copied over to
* StripeClient.v1().sharedPayment(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.SharedPaymentService sharedPayment() {
return new com.stripe.service.SharedPaymentService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.shippingRates() is deprecated, use StripeClient.v1().shippingRates()
* instead. All functionality under it has been copied over to
* StripeClient.v1().shippingRates(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.ShippingRateService shippingRates() {
return new com.stripe.service.ShippingRateService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.sigma() is deprecated, use StripeClient.v1().sigma() instead. All
* functionality under it has been copied over to StripeClient.v1().sigma(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.SigmaService sigma() {
return new com.stripe.service.SigmaService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.sources() is deprecated, use StripeClient.v1().sources() instead. All
* functionality under it has been copied over to StripeClient.v1().sources(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.SourceService sources() {
return new com.stripe.service.SourceService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.subscriptionItems() is deprecated, use
* StripeClient.v1().subscriptionItems() instead. All functionality under it has been copied
* over to StripeClient.v1().subscriptionItems(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.SubscriptionItemService subscriptionItems() {
return new com.stripe.service.SubscriptionItemService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.subscriptionSchedules() is deprecated, use
* StripeClient.v1().subscriptionSchedules() instead. All functionality under it has been
* copied over to StripeClient.v1().subscriptionSchedules(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.SubscriptionScheduleService subscriptionSchedules() {
return new com.stripe.service.SubscriptionScheduleService(this.getResponseGetter());
}
/**
* @deprecated StripeClient.subscriptions() is deprecated, use StripeClient.v1().subscriptions()
* instead. All functionality under it has been copied over to
* StripeClient.v1().subscriptions(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.SubscriptionService subscriptions() {