/
PaymentIntents.d.ts
4162 lines (3460 loc) · 147 KB
/
PaymentIntents.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
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
declare module 'stripe' {
namespace Stripe {
/**
* The PaymentIntent object.
*/
interface PaymentIntent {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'payment_intent';
/**
* Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
*/
amount: number;
/**
* Amount that can be captured from this PaymentIntent.
*/
amount_capturable: number;
/**
* Amount that was collected by this PaymentIntent.
*/
amount_received: number;
/**
* ID of the Connect application that created the PaymentIntent.
*/
application: string | Stripe.Application | null;
/**
* The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
*/
application_fee_amount: number | null;
/**
* Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods)
*/
automatic_payment_methods: PaymentIntent.AutomaticPaymentMethods | null;
/**
* Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.
*/
canceled_at: number | null;
/**
* Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`).
*/
cancellation_reason: PaymentIntent.CancellationReason | null;
/**
* Controls when the funds will be captured from the customer's account.
*/
capture_method: PaymentIntent.CaptureMethod;
/**
* Charges that were created by this PaymentIntent, if any.
*/
charges: ApiList<Stripe.Charge>;
/**
* The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.
*
* The client secret can be used to complete a payment from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
*
* Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment?integration=elements) and learn about how `client_secret` should be handled.
*/
client_secret: string | null;
confirmation_method: PaymentIntent.ConfirmationMethod;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* ID of the Customer this PaymentIntent belongs to, if one exists.
*
* Payment methods attached to other Customers cannot be used with this PaymentIntent.
*
* If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.
*/
customer: string | Stripe.Customer | Stripe.DeletedCustomer | null;
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
description: string | null;
/**
* ID of the invoice that created this PaymentIntent, if it exists.
*/
invoice: string | Stripe.Invoice | null;
/**
* The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason.
*/
last_payment_error: PaymentIntent.LastPaymentError | null;
/**
* 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. For more information, see the [documentation](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata).
*/
metadata: Stripe.Metadata;
/**
* If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.
*/
next_action: PaymentIntent.NextAction | null;
/**
* The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details.
*/
on_behalf_of: string | Stripe.Account | null;
/**
* ID of the payment method used in this PaymentIntent.
*/
payment_method: string | Stripe.PaymentMethod | null;
/**
* Payment-method-specific configuration for this PaymentIntent.
*/
payment_method_options: PaymentIntent.PaymentMethodOptions | null;
/**
* The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.
*/
payment_method_types: Array<string>;
/**
* If present, this property tells you about the processing state of the payment.
*/
processing: PaymentIntent.Processing | null;
/**
* Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).
*/
receipt_email: string | null;
/**
* ID of the review associated with this PaymentIntent, if any.
*/
review: string | Stripe.Review | null;
/**
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
*
* Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.
*
* When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
*/
setup_future_usage: PaymentIntent.SetupFutureUsage | null;
/**
* Shipping information for this PaymentIntent.
*/
shipping: PaymentIntent.Shipping | null;
/**
* This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied.
*/
source:
| string
| Stripe.CustomerSource
| Stripe.DeletedAlipayAccount
| Stripe.DeletedBankAccount
| Stripe.DeletedBitcoinReceiver
| Stripe.DeletedCard
| null;
/**
* For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters.
*/
statement_descriptor: string | null;
/**
* Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
*/
statement_descriptor_suffix: string | null;
/**
* Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses).
*/
status: PaymentIntent.Status;
/**
* The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details.
*/
transfer_data: PaymentIntent.TransferData | null;
/**
* A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details.
*/
transfer_group: string | null;
}
namespace PaymentIntent {
interface AutomaticPaymentMethods {
/**
* Automatically calculates compatible payment methods
*/
enabled: boolean;
}
type CancellationReason =
| 'abandoned'
| 'automatic'
| 'duplicate'
| 'failed_invoice'
| 'fraudulent'
| 'requested_by_customer'
| 'void_invoice';
type CaptureMethod = 'automatic' | 'manual';
type ConfirmationMethod = 'automatic' | 'manual';
interface LastPaymentError {
/**
* For card errors, the ID of the failed charge.
*/
charge?: string;
/**
* For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported.
*/
code?: string;
/**
* For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one.
*/
decline_code?: string;
/**
* A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported.
*/
doc_url?: string;
/**
* A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
*/
message?: string;
/**
* If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
*/
param?: string;
/**
* A PaymentIntent guides you through the process of collecting a payment from your customer.
* We recommend that you create exactly one PaymentIntent for each order or
* customer session in your system. You can reference the PaymentIntent later to
* see the history of payment attempts for a particular session.
*
* A PaymentIntent transitions through
* [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses)
* throughout its lifetime as it interfaces with Stripe.js to perform
* authentication flows and ultimately creates at most one successful charge.
*
* Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents).
*/
payment_intent?: Stripe.PaymentIntent;
/**
* PaymentMethod objects represent your customer's payment instruments.
* They can be used with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or saved 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).
*/
payment_method?: Stripe.PaymentMethod;
/**
* If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.
*/
payment_method_type?: string;
/**
* A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.
* For example, you could use a SetupIntent to set up and save your customer's card without immediately collecting a payment.
* Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow.
*
* Create a SetupIntent as soon as you're ready to collect your customer's payment credentials.
* Do not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid.
* The SetupIntent then transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides
* you through the setup process.
*
* Successful SetupIntents result in payment credentials that are optimized for future payments.
* For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) may need to be run through
* [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) at the time of payment method collection
* in order to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents).
* If the SetupIntent is used with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), upon success,
* it will automatically attach the resulting payment method to that Customer.
* We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on
* PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods.
*
* By using SetupIntents, you ensure that your customers experience the minimum set of required friction,
* even as regulations change over time.
*
* Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents).
*/
setup_intent?: Stripe.SetupIntent;
source?: Stripe.CustomerSource;
/**
* The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`
*/
type: LastPaymentError.Type;
}
namespace LastPaymentError {
type Type =
| 'api_error'
| 'card_error'
| 'idempotency_error'
| 'invalid_request_error';
}
interface NextAction {
alipay_handle_redirect?: NextAction.AlipayHandleRedirect;
boleto_display_details?: NextAction.BoletoDisplayDetails;
oxxo_display_details?: NextAction.OxxoDisplayDetails;
redirect_to_url?: NextAction.RedirectToUrl;
/**
* Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`.
*/
type: string;
/**
* When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
*/
use_stripe_sdk?: NextAction.UseStripeSdk;
verify_with_microdeposits?: NextAction.VerifyWithMicrodeposits;
wechat_pay_display_qr_code?: NextAction.WechatPayDisplayQrCode;
wechat_pay_redirect_to_android_app?: NextAction.WechatPayRedirectToAndroidApp;
wechat_pay_redirect_to_ios_app?: NextAction.WechatPayRedirectToIosApp;
}
namespace NextAction {
interface AlipayHandleRedirect {
/**
* The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App.
*/
native_data: string | null;
/**
* The native URL you must redirect your customer to in order to authenticate the payment in an iOS App.
*/
native_url: string | null;
/**
* If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.
*/
return_url: string | null;
/**
* The URL you must redirect your customer to in order to authenticate the payment.
*/
url: string | null;
}
interface BoletoDisplayDetails {
/**
* The timestamp after which the boleto expires.
*/
expires_at: number | null;
/**
* The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher.
*/
hosted_voucher_url: string | null;
/**
* The boleto number.
*/
number: string | null;
/**
* The URL to the downloadable boleto voucher PDF.
*/
pdf: string | null;
}
interface OxxoDisplayDetails {
/**
* The timestamp after which the OXXO voucher expires.
*/
expires_after: number | null;
/**
* The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher.
*/
hosted_voucher_url: string | null;
/**
* OXXO reference number.
*/
number: string | null;
}
interface RedirectToUrl {
/**
* If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.
*/
return_url: string | null;
/**
* The URL you must redirect your customer to in order to authenticate the payment.
*/
url: string | null;
}
interface UseStripeSdk {}
interface VerifyWithMicrodeposits {
/**
* The timestamp when the microdeposits are expected to land.
*/
arrival_date: number;
/**
* The URL for the hosted verification page, which allows customers to verify their bank account.
*/
hosted_verification_url: string;
}
interface WechatPayDisplayQrCode {
/**
* The data being used to generate QR code
*/
data: string;
/**
* The base64 image data for a pre-generated QR code
*/
image_data_url: string;
/**
* The image_url_png string used to render QR code
*/
image_url_png: string;
/**
* The image_url_svg string used to render QR code
*/
image_url_svg: string;
}
interface WechatPayRedirectToAndroidApp {
/**
* app_id is the APP ID registered on WeChat open platform
*/
app_id: string;
/**
* nonce_str is a random string
*/
nonce_str: string;
/**
* package is static value
*/
package: string;
/**
* an unique merchant ID assigned by Wechat Pay
*/
partner_id: string;
/**
* an unique trading ID assigned by Wechat Pay
*/
prepay_id: string;
/**
* A signature
*/
sign: string;
/**
* Specifies the current time in epoch format
*/
timestamp: string;
}
interface WechatPayRedirectToIosApp {
/**
* An universal link that redirect to Wechat Pay APP
*/
native_url: string;
}
}
interface PaymentMethodOptions {
acss_debit?: PaymentMethodOptions.AcssDebit;
afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay;
alipay?: PaymentMethodOptions.Alipay;
au_becs_debit?: PaymentMethodOptions.AuBecsDebit;
bacs_debit?: PaymentMethodOptions.BacsDebit;
bancontact?: PaymentMethodOptions.Bancontact;
boleto?: PaymentMethodOptions.Boleto;
card?: PaymentMethodOptions.Card;
card_present?: PaymentMethodOptions.CardPresent;
eps?: PaymentMethodOptions.Eps;
fpx?: PaymentMethodOptions.Fpx;
giropay?: PaymentMethodOptions.Giropay;
grabpay?: PaymentMethodOptions.Grabpay;
ideal?: PaymentMethodOptions.Ideal;
interac_present?: PaymentMethodOptions.InteracPresent;
klarna?: PaymentMethodOptions.Klarna;
oxxo?: PaymentMethodOptions.Oxxo;
p24?: PaymentMethodOptions.P24;
sepa_debit?: PaymentMethodOptions.SepaDebit;
sofort?: PaymentMethodOptions.Sofort;
wechat_pay?: PaymentMethodOptions.WechatPay;
}
namespace PaymentMethodOptions {
interface AcssDebit {
mandate_options?: AcssDebit.MandateOptions;
/**
* Bank account verification method.
*/
verification_method?: AcssDebit.VerificationMethod;
}
namespace AcssDebit {
interface MandateOptions {
/**
* A URL for custom mandate text
*/
custom_mandate_url?: string;
/**
* Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'.
*/
interval_description: string | null;
/**
* Payment schedule for the mandate.
*/
payment_schedule: MandateOptions.PaymentSchedule | null;
/**
* Transaction type of the mandate.
*/
transaction_type: MandateOptions.TransactionType | null;
}
namespace MandateOptions {
type PaymentSchedule = 'combined' | 'interval' | 'sporadic';
type TransactionType = 'business' | 'personal';
}
type VerificationMethod = 'automatic' | 'instant' | 'microdeposits';
}
interface AfterpayClearpay {
/**
* Order identifier shown to the merchant in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about
* the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes.
*/
reference: string | null;
}
interface Alipay {}
interface AuBecsDebit {}
interface BacsDebit {}
interface Bancontact {
/**
* Preferred language of the Bancontact authorization page that the customer is redirected to.
*/
preferred_language: Bancontact.PreferredLanguage;
}
namespace Bancontact {
type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl';
}
interface Boleto {
/**
* The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time.
*/
expires_after_days: number;
}
interface Card {
/**
* Installment details for this payment (Mexico only).
*
* For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
*/
installments: Card.Installments | null;
/**
* Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time.
*/
network: Card.Network | null;
/**
* We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
*/
request_three_d_secure: Card.RequestThreeDSecure | null;
/**
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
*
* Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.
*
* When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
*/
setup_future_usage?: Card.SetupFutureUsage;
}
namespace Card {
interface Installments {
/**
* Installment plans that may be selected for this PaymentIntent.
*/
available_plans: Array<Installments.AvailablePlan> | null;
/**
* Whether Installments are enabled for this PaymentIntent.
*/
enabled: boolean;
/**
* Installment plan selected for this PaymentIntent.
*/
plan: Installments.Plan | null;
}
namespace Installments {
interface AvailablePlan {
/**
* For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.
*/
count: number | null;
/**
* For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.
* One of `month`.
*/
interval: 'month' | null;
/**
* Type of installment plan, one of `fixed_count`.
*/
type: 'fixed_count';
}
interface Plan {
/**
* For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.
*/
count: number | null;
/**
* For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.
* One of `month`.
*/
interval: 'month' | null;
/**
* Type of installment plan, one of `fixed_count`.
*/
type: 'fixed_count';
}
}
type Network =
| 'amex'
| 'cartes_bancaires'
| 'diners'
| 'discover'
| 'interac'
| 'jcb'
| 'mastercard'
| 'unionpay'
| 'unknown'
| 'visa';
type RequestThreeDSecure = 'any' | 'automatic' | 'challenge_only';
type SetupFutureUsage = 'none' | 'off_session' | 'on_session';
}
interface CardPresent {}
interface Eps {}
interface Fpx {}
interface Giropay {}
interface Grabpay {}
interface Ideal {}
interface InteracPresent {}
interface Klarna {
/**
* Preferred locale of the Klarna checkout page that the customer is redirected to.
*/
preferred_locale: string | null;
}
interface Oxxo {
/**
* The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
*/
expires_after_days: number;
}
interface P24 {}
interface SepaDebit {
mandate_options?: SepaDebit.MandateOptions;
}
namespace SepaDebit {
interface MandateOptions {}
}
interface Sofort {
/**
* Preferred language of the SOFORT authorization page that the customer is redirected to.
*/
preferred_language: Sofort.PreferredLanguage | null;
}
namespace Sofort {
type PreferredLanguage =
| 'de'
| 'en'
| 'es'
| 'fr'
| 'it'
| 'nl'
| 'pl';
}
interface WechatPay {
/**
* The app ID registered with WeChat Pay. Only required when client is ios or android.
*/
app_id: string | null;
/**
* The client type that the end customer will pay from
*/
client: WechatPay.Client | null;
}
namespace WechatPay {
type Client = 'android' | 'ios' | 'web';
}
}
interface Processing {
card?: Processing.Card;
/**
* Type of the payment method for which payment is in `processing` state, one of `card`.
*/
type: 'card';
}
namespace Processing {
interface Card {}
}
type SetupFutureUsage = 'off_session' | 'on_session';
interface Shipping {
address?: Stripe.Address;
/**
* The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
*/
carrier?: string | null;
/**
* Recipient name.
*/
name?: string | null;
/**
* Recipient phone (including extension).
*/
phone?: string | null;
/**
* The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
*/
tracking_number?: string | null;
}
type Status =
| 'canceled'
| 'processing'
| 'requires_action'
| 'requires_capture'
| 'requires_confirmation'
| 'requires_payment_method'
| 'succeeded';
interface TransferData {
/**
* Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
*/
amount?: number;
/**
* The account (if any) the payment will be attributed to for tax
* reporting, and where funds from the payment will be transferred to upon
* payment success.
*/
destination: string | Stripe.Account;
}
}
interface PaymentIntentCreateParams {
/**
* Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
*/
amount: number;
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
*/
application_fee_amount?: number;
/**
* When enabled, this PaymentIntent will accept payment methods that you have enabled in the Dashboard and are compatible with this PaymentIntent's other parameters.
*/
automatic_payment_methods?: PaymentIntentCreateParams.AutomaticPaymentMethods;
/**
* Controls when the funds will be captured from the customer's account.
*/
capture_method?: PaymentIntentCreateParams.CaptureMethod;
/**
* Set to `true` to attempt to [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, parameters available in the [confirm](https://stripe.com/docs/api/payment_intents/confirm) API may also be provided.
*/
confirm?: boolean;
confirmation_method?: PaymentIntentCreateParams.ConfirmationMethod;
/**
* ID of the Customer this PaymentIntent belongs to, if one exists.
*
* Payment methods attached to other Customers cannot be used with this PaymentIntent.
*
* If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.
*/
customer?: string;
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
description?: string;
/**
* Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
*/
error_on_requires_action?: boolean;
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
/**
* ID of the mandate to be used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
*/
mandate?: string;
/**
* This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
*/
mandate_data?: PaymentIntentCreateParams.MandateData;
/**
* 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: Stripe.MetadataParam;
/**
* Set to `true` to indicate that the customer is not in your checkout flow during this payment attempt, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
*/
off_session?: boolean | PaymentIntentCreateParams.OffSession;
/**
* The Stripe account ID for which these funds are intended. For details, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
*/
on_behalf_of?: string;
/**
* ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent.
*
* If neither the `payment_method` parameter nor the `source` parameter are provided with `confirm=true`, `source` will be automatically populated with `customer.default_source` to improve the migration experience for users of the Charges API. We recommend that you explicitly provide the `payment_method` going forward.
*/
payment_method?: string;
/**
* If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear
* in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method)
* property on the PaymentIntent.
*/
payment_method_data?: PaymentIntentCreateParams.PaymentMethodData;
/**
* Payment-method-specific configuration for this PaymentIntent.
*/
payment_method_options?: PaymentIntentCreateParams.PaymentMethodOptions;
/**
* The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. If this is not provided, defaults to ["card"].
*/
payment_method_types?: Array<string>;
/**
* Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).
*/
receipt_email?: string;
/**
* The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm).
*/
return_url?: string;
/**
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
*
* Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.
*
* When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
*/
setup_future_usage?: PaymentIntentCreateParams.SetupFutureUsage;