-
Notifications
You must be signed in to change notification settings - Fork 719
/
PaymentMethods.d.ts
791 lines (637 loc) · 22.8 KB
/
PaymentMethods.d.ts
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
// File generated from our OpenAPI spec
declare module 'stripe' {
namespace Stripe {
/**
* PaymentMethod objects represent your customer's payment instruments.
* You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to
* Customer objects to store instrument details for future payments.
*
* Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
*/
interface PaymentMethod {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'payment_method';
acss_debit?: PaymentMethod.AcssDebit;
affirm?: PaymentMethod.Affirm;
afterpay_clearpay?: PaymentMethod.AfterpayClearpay;
alipay?: PaymentMethod.Alipay;
au_becs_debit?: PaymentMethod.AuBecsDebit;
bacs_debit?: PaymentMethod.BacsDebit;
bancontact?: PaymentMethod.Bancontact;
billing_details: PaymentMethod.BillingDetails;
blik?: PaymentMethod.Blik;
boleto?: PaymentMethod.Boleto;
card?: PaymentMethod.Card;
card_present?: PaymentMethod.CardPresent;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.
*/
customer: string | Stripe.Customer | null;
customer_balance?: PaymentMethod.CustomerBalance;
eps?: PaymentMethod.Eps;
fpx?: PaymentMethod.Fpx;
giropay?: PaymentMethod.Giropay;
grabpay?: PaymentMethod.Grabpay;
ideal?: PaymentMethod.Ideal;
interac_present?: PaymentMethod.InteracPresent;
klarna?: PaymentMethod.Klarna;
konbini?: PaymentMethod.Konbini;
link?: PaymentMethod.Link;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata: Stripe.Metadata | null;
oxxo?: PaymentMethod.Oxxo;
p24?: PaymentMethod.P24;
paynow?: PaymentMethod.Paynow;
pix?: PaymentMethod.Pix;
promptpay?: PaymentMethod.Promptpay;
/**
* Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
*/
radar_options?: PaymentMethod.RadarOptions;
sepa_debit?: PaymentMethod.SepaDebit;
sofort?: PaymentMethod.Sofort;
/**
* The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
*/
type: PaymentMethod.Type;
us_bank_account?: PaymentMethod.UsBankAccount;
wechat_pay?: PaymentMethod.WechatPay;
}
namespace PaymentMethod {
interface AcssDebit {
/**
* Name of the bank associated with the bank account.
*/
bank_name: string | null;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;
/**
* Institution number of the bank account.
*/
institution_number: string | null;
/**
* Last four digits of the bank account number.
*/
last4: string | null;
/**
* Transit number of the bank account.
*/
transit_number: string | null;
}
interface Affirm {}
interface AfterpayClearpay {}
interface Alipay {}
interface AuBecsDebit {
/**
* Six-digit number identifying bank and branch associated with this bank account.
*/
bsb_number: string | null;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;
/**
* Last four digits of the bank account number.
*/
last4: string | null;
}
interface BacsDebit {
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;
/**
* Last four digits of the bank account number.
*/
last4: string | null;
/**
* Sort code of the bank account. (e.g., `10-20-30`)
*/
sort_code: string | null;
}
interface Bancontact {}
interface BillingDetails {
/**
* Billing address.
*/
address: Stripe.Address | null;
/**
* Email address.
*/
email: string | null;
/**
* Full name.
*/
name: string | null;
/**
* Billing phone number (including extension).
*/
phone: string | null;
}
interface Blik {}
interface Boleto {
/**
* Uniquely identifies the customer tax id (CNPJ or CPF)
*/
tax_id: string;
}
interface Card {
/**
* Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
*/
brand: string;
/**
* Checks on Card address and CVC if provided.
*/
checks: Card.Checks | null;
/**
* Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
*/
country: string | null;
/**
* A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)
*/
description?: string | null;
/**
* Two-digit number representing the card's expiration month.
*/
exp_month: number;
/**
* Four-digit number representing the card's expiration year.
*/
exp_year: number;
/**
* Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.
*
* *Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*
*/
fingerprint?: string | null;
/**
* Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.
*/
funding: string;
/**
* Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
*/
iin?: string | null;
/**
* The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)
*/
issuer?: string | null;
/**
* The last four digits of the card.
*/
last4: string;
/**
* Contains information about card networks that can be used to process the payment.
*/
networks: Card.Networks | null;
/**
* Contains details on how this Card maybe be used for 3D Secure authentication.
*/
three_d_secure_usage: Card.ThreeDSecureUsage | null;
/**
* If this Card is part of a card wallet, this contains the details of the card wallet.
*/
wallet: Card.Wallet | null;
}
namespace Card {
interface Checks {
/**
* If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
*/
address_line1_check: string | null;
/**
* If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
*/
address_postal_code_check: string | null;
/**
* If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.
*/
cvc_check: string | null;
}
interface Networks {
/**
* All available networks for the card.
*/
available: Array<string>;
/**
* The preferred network for the card.
*/
preferred: string | null;
}
interface ThreeDSecureUsage {
/**
* Whether 3D Secure is supported on this card.
*/
supported: boolean;
}
interface Wallet {
amex_express_checkout?: Wallet.AmexExpressCheckout;
apple_pay?: Wallet.ApplePay;
/**
* (For tokenized numbers only.) The last four digits of the device account number.
*/
dynamic_last4: string | null;
google_pay?: Wallet.GooglePay;
masterpass?: Wallet.Masterpass;
samsung_pay?: Wallet.SamsungPay;
/**
* The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, or `visa_checkout`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type.
*/
type: Wallet.Type;
visa_checkout?: Wallet.VisaCheckout;
}
namespace Wallet {
interface AmexExpressCheckout {}
interface ApplePay {}
interface GooglePay {}
interface Masterpass {
/**
* Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
*/
billing_address: Stripe.Address | null;
/**
* Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
*/
email: string | null;
/**
* Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
*/
name: string | null;
/**
* Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
*/
shipping_address: Stripe.Address | null;
}
interface SamsungPay {}
type Type =
| 'amex_express_checkout'
| 'apple_pay'
| 'google_pay'
| 'masterpass'
| 'samsung_pay'
| 'visa_checkout';
interface VisaCheckout {
/**
* Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
*/
billing_address: Stripe.Address | null;
/**
* Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
*/
email: string | null;
/**
* Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
*/
name: string | null;
/**
* Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
*/
shipping_address: Stripe.Address | null;
}
}
}
interface CardPresent {}
interface CustomerBalance {}
interface Eps {
/**
* The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.
*/
bank: Eps.Bank | null;
}
namespace Eps {
type Bank =
| 'arzte_und_apotheker_bank'
| 'austrian_anadi_bank_ag'
| 'bank_austria'
| 'bankhaus_carl_spangler'
| 'bankhaus_schelhammer_und_schattera_ag'
| 'bawag_psk_ag'
| 'bks_bank_ag'
| 'brull_kallmus_bank_ag'
| 'btv_vier_lander_bank'
| 'capital_bank_grawe_gruppe_ag'
| 'deutsche_bank_ag'
| 'dolomitenbank'
| 'easybank_ag'
| 'erste_bank_und_sparkassen'
| 'hypo_alpeadriabank_international_ag'
| 'hypo_bank_burgenland_aktiengesellschaft'
| 'hypo_noe_lb_fur_niederosterreich_u_wien'
| 'hypo_oberosterreich_salzburg_steiermark'
| 'hypo_tirol_bank_ag'
| 'hypo_vorarlberg_bank_ag'
| 'marchfelder_bank'
| 'oberbank_ag'
| 'raiffeisen_bankengruppe_osterreich'
| 'schoellerbank_ag'
| 'sparda_bank_wien'
| 'volksbank_gruppe'
| 'volkskreditbank_ag'
| 'vr_bank_braunau';
}
interface Fpx {
/**
* Account holder type, if provided. Can be one of `individual` or `company`.
*/
account_holder_type: Fpx.AccountHolderType | null;
/**
* The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`.
*/
bank: Fpx.Bank;
}
namespace Fpx {
type AccountHolderType = 'company' | 'individual';
type Bank =
| 'affin_bank'
| 'agrobank'
| 'alliance_bank'
| 'ambank'
| 'bank_islam'
| 'bank_muamalat'
| 'bank_of_china'
| 'bank_rakyat'
| 'bsn'
| 'cimb'
| 'deutsche_bank'
| 'hong_leong_bank'
| 'hsbc'
| 'kfh'
| 'maybank2e'
| 'maybank2u'
| 'ocbc'
| 'pb_enterprise'
| 'public_bank'
| 'rhb'
| 'standard_chartered'
| 'uob';
}
interface Giropay {}
interface Grabpay {}
interface Ideal {
/**
* The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, or `van_lanschot`.
*/
bank: Ideal.Bank | null;
/**
* The Bank Identifier Code of the customer's bank, if the bank was provided.
*/
bic: Ideal.Bic | null;
}
namespace Ideal {
type Bank =
| 'abn_amro'
| 'asn_bank'
| 'bunq'
| 'handelsbanken'
| 'ing'
| 'knab'
| 'moneyou'
| 'rabobank'
| 'regiobank'
| 'revolut'
| 'sns_bank'
| 'triodos_bank'
| 'van_lanschot';
type Bic =
| 'ABNANL2A'
| 'ASNBNL21'
| 'BUNQNL2A'
| 'FVLBNL22'
| 'HANDNL2A'
| 'INGBNL2A'
| 'KNABNL2H'
| 'MOYONL21'
| 'RABONL2U'
| 'RBRBNL21'
| 'REVOLT21'
| 'SNSBNL2A'
| 'TRIONL2U';
}
interface InteracPresent {}
interface Klarna {
/**
* The customer's date of birth, if provided.
*/
dob: Klarna.Dob | null;
}
namespace Klarna {
interface Dob {
/**
* The day of birth, between 1 and 31.
*/
day: number | null;
/**
* The month of birth, between 1 and 12.
*/
month: number | null;
/**
* The four-digit year of birth.
*/
year: number | null;
}
}
interface Konbini {}
interface Link {
/**
* Account owner's email address.
*/
email: string | null;
/**
* Token used for persistent Link logins.
*/
persistent_token?: string;
}
interface Oxxo {}
interface P24 {
/**
* The customer's bank, if provided.
*/
bank: P24.Bank | null;
}
namespace P24 {
type Bank =
| 'alior_bank'
| 'bank_millennium'
| 'bank_nowy_bfg_sa'
| 'bank_pekao_sa'
| 'banki_spbdzielcze'
| 'blik'
| 'bnp_paribas'
| 'boz'
| 'citi_handlowy'
| 'credit_agricole'
| 'envelobank'
| 'etransfer_pocztowy24'
| 'getin_bank'
| 'ideabank'
| 'ing'
| 'inteligo'
| 'mbank_mtransfer'
| 'nest_przelew'
| 'noble_pay'
| 'pbac_z_ipko'
| 'plus_bank'
| 'santander_przelew24'
| 'tmobile_usbugi_bankowe'
| 'toyota_bank'
| 'volkswagen_bank';
}
interface Paynow {}
interface Pix {}
interface Promptpay {}
interface RadarOptions {
/**
* A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.
*/
session?: string;
}
interface SepaDebit {
/**
* Bank code of bank associated with the bank account.
*/
bank_code: string | null;
/**
* Branch code of bank associated with the bank account.
*/
branch_code: string | null;
/**
* Two-letter ISO code representing the country the bank account is located in.
*/
country: string | null;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;
/**
* Information about the object that generated this PaymentMethod.
*/
generated_from: SepaDebit.GeneratedFrom | null;
/**
* Last four characters of the IBAN.
*/
last4: string | null;
}
namespace SepaDebit {
interface GeneratedFrom {
/**
* The ID of the Charge that generated this PaymentMethod, if any.
*/
charge: string | Stripe.Charge | null;
/**
* The ID of the SetupAttempt that generated this PaymentMethod, if any.
*/
setup_attempt: string | Stripe.SetupAttempt | null;
}
}
interface Sofort {
/**
* Two-letter ISO code representing the country the bank account is located in.
*/
country: string | null;
}
type Type =
| 'acss_debit'
| 'affirm'
| 'afterpay_clearpay'
| 'alipay'
| 'au_becs_debit'
| 'bacs_debit'
| 'bancontact'
| 'blik'
| 'boleto'
| 'card'
| 'card_present'
| 'customer_balance'
| 'eps'
| 'fpx'
| 'giropay'
| 'grabpay'
| 'ideal'
| 'interac_present'
| 'klarna'
| 'konbini'
| 'link'
| 'oxxo'
| 'p24'
| 'paynow'
| 'pix'
| 'promptpay'
| 'sepa_debit'
| 'sofort'
| 'us_bank_account'
| 'wechat_pay';
interface UsBankAccount {
/**
* Account holder type: individual or company.
*/
account_holder_type: UsBankAccount.AccountHolderType | null;
/**
* Account type: checkings or savings. Defaults to checking if omitted.
*/
account_type: UsBankAccount.AccountType | null;
/**
* The name of the bank.
*/
bank_name: string | null;
/**
* The ID of the Financial Connections Account used to create the payment method.
*/
financial_connections_account?: string | null;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;
/**
* Last four digits of the bank account number.
*/
last4: string | null;
/**
* Contains information about US bank account networks that can be used.
*/
networks: UsBankAccount.Networks | null;
/**
* Routing number of the bank account.
*/
routing_number: string | null;
}
namespace UsBankAccount {
type AccountHolderType = 'company' | 'individual';
type AccountType = 'checking' | 'savings';
interface Networks {
/**
* The preferred network.
*/
preferred: string | null;
/**
* All supported networks.
*/
supported: Array<Networks.Supported>;
}
namespace Networks {
type Supported = 'ach' | 'us_domestic_wire';
}
}
interface WechatPay {}
}
}
}