|
1 |
| -import { |
2 |
| - CustomFont, |
3 |
| - PaymentIntent, |
4 |
| - PaymentMethod, |
5 |
| - StripeConfigurationOptions, |
6 |
| -} from '../stripev3/stripev3'; |
7 |
| - |
8 |
| -export { StripeAdditionalAction } from '../stripev3/stripev3'; |
| 1 | +/** |
| 2 | + * Initialization options. |
| 3 | + */ |
| 4 | +export interface StripeConfigurationOptions { |
| 5 | + /** |
| 6 | + * For usage with [Connect](https://stripe.com/docs/connect) only. |
| 7 | + * Specifying a connected account ID (e.g., acct_24BFMpJ1svR5A89k) allows you to perform actions on behalf of that account. |
| 8 | + */ |
| 9 | + stripeAccount: string; |
| 10 | + |
| 11 | + /** |
| 12 | + * Override your account's [API version](https://stripe.com/docs/api/versioning) |
| 13 | + */ |
| 14 | + apiVersion?: string; |
| 15 | + |
| 16 | + /** |
| 17 | + * A locale used to globally configure localization in Stripe. Setting the locale here will localize error strings for all Stripe.js methods. It will also configure the locale for Elements and Checkout. Default is auto (Stripe detects the locale of the browser). |
| 18 | + * Note that Checkout supports a slightly different set of locales than Stripe.js. |
| 19 | + */ |
| 20 | + locale?: string; |
| 21 | + |
| 22 | + betas?: string[]; |
| 23 | +} |
| 24 | + |
| 25 | +export interface StripeAdditionalActionData { |
| 26 | + redirect_url?: string; |
| 27 | + intent?: string; |
| 28 | +} |
| 29 | + |
| 30 | +export interface StripeAdditionalAction { |
| 31 | + type: string; |
| 32 | + data: StripeAdditionalActionData; |
| 33 | +} |
| 34 | + |
| 35 | +/** |
| 36 | + * The PaymentIntent object. |
| 37 | + */ |
| 38 | +export interface PaymentIntent { |
| 39 | + /** |
| 40 | + * Unique identifier for the object. |
| 41 | + */ |
| 42 | + id: string; |
| 43 | + |
| 44 | + /** |
| 45 | + * Status of this PaymentIntent. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). |
| 46 | + */ |
| 47 | + status: 'succeeded' | string; |
| 48 | + |
| 49 | + /** |
| 50 | + * The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. |
| 51 | + */ |
| 52 | + last_payment_error: LastPaymentError | null; |
| 53 | +} |
| 54 | + |
| 55 | +/** |
| 56 | + * The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. |
| 57 | + */ |
| 58 | +export interface LastPaymentError { |
| 59 | + /** |
| 60 | + * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. |
| 61 | + */ |
| 62 | + message?: string; |
| 63 | +} |
| 64 | + |
| 65 | +/** |
| 66 | + * The PaymentMethod object |
| 67 | + */ |
| 68 | +export interface PaymentMethod { |
| 69 | + /** |
| 70 | + * Unique identifier for the object. |
| 71 | + */ |
| 72 | + id: string; |
| 73 | + |
| 74 | + /** |
| 75 | + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. |
| 76 | + * It contains additional information specific to the PaymentMethod type. |
| 77 | + */ |
| 78 | + type: string; |
| 79 | +} |
| 80 | + |
| 81 | +/** |
| 82 | + * This object is used to pass custom fonts when creating an [Elements](https://stripe.com/docs/js/elements_object/create) object. |
| 83 | + */ |
| 84 | +export interface CssFontSource { |
| 85 | + /** |
| 86 | + * A relative or absolute URL pointing to a CSS file with [@font-face](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face) definitions, for example: |
| 87 | + * `https://fonts.googleapis.com/css?family=Open+Sans` |
| 88 | + * Note that if you are using a [content security policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) (CSP), |
| 89 | + * [additional directives](https://stripe.com/docs/security#content-security-policy) may be necessary. |
| 90 | + */ |
| 91 | + cssSrc: string; |
| 92 | +} |
| 93 | + |
| 94 | +/** |
| 95 | + * This object is used to pass custom fonts when creating an [Elements](https://stripe.com/docs/js/elements_object/create) object. |
| 96 | + */ |
| 97 | +export interface CustomFontSource { |
| 98 | + /** |
| 99 | + * The name to give the font. |
| 100 | + */ |
| 101 | + family: string; |
| 102 | + |
| 103 | + /** |
| 104 | + * A valid [src](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src) value pointing to your |
| 105 | + * custom font file. This is usually (though not always) a link to a file with a .woff , .otf, or .svg suffix. |
| 106 | + */ |
| 107 | + src: string; |
| 108 | + |
| 109 | + /** |
| 110 | + * A valid [font-display](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display) value. |
| 111 | + */ |
| 112 | + display?: string; |
| 113 | + |
| 114 | + /** |
| 115 | + * One of normal, italic, oblique. Defaults to normal. |
| 116 | + */ |
| 117 | + style?: string; |
| 118 | + |
| 119 | + /** |
| 120 | + * A valid [unicode-range](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range) value. |
| 121 | + */ |
| 122 | + unicodeRange?: string; |
| 123 | + |
| 124 | + /** |
| 125 | + * A valid [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight). Note that this is a string, not a number. |
| 126 | + */ |
| 127 | + weight?: string; |
| 128 | +} |
| 129 | + |
| 130 | +export type CustomFont = CssFontSource | CustomFontSource; |
9 | 131 |
|
10 | 132 | export interface StripeError {
|
11 | 133 | /**
|
|
0 commit comments