@stripe/stripe-js 2.3.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/pure.js +1 -1
- package/dist/{pure.esm.js → pure.mjs} +1 -1
- package/dist/stripe.js +1 -1
- package/dist/{stripe.esm.js → stripe.mjs} +1 -1
- package/package.json +17 -6
- package/types/stripe-js/elements/card-number.d.ts +43 -2
- package/types/stripe-js/elements/card.d.ts +13 -3
- package/types/stripe-js/elements-group.d.ts +20 -0
- package/pure.js +0 -1
- /package/{pure.d.ts → types/pure.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -16,6 +16,10 @@ of features of Stripe.js.
|
|
|
16
16
|
|
|
17
17
|
[](https://www.npmjs.com/package/@stripe/stripe-js)
|
|
18
18
|
|
|
19
|
+
## Minimum requirements
|
|
20
|
+
|
|
21
|
+
- Node.js: v12.16
|
|
22
|
+
|
|
19
23
|
## Installation
|
|
20
24
|
|
|
21
25
|
Use `npm` to install the Stripe.js module:
|
package/dist/pure.js
CHANGED
package/dist/stripe.js
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Stripe.js loading utility",
|
|
5
5
|
"repository": "github:stripe/stripe-js",
|
|
6
6
|
"main": "dist/stripe.js",
|
|
7
|
-
"module": "dist/stripe.
|
|
8
|
-
"
|
|
7
|
+
"module": "dist/stripe.mjs",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/stripe.mjs",
|
|
11
|
+
"default": "./dist/stripe.js"
|
|
12
|
+
},
|
|
13
|
+
"./pure": {
|
|
14
|
+
"import": "./dist/pure.mjs",
|
|
15
|
+
"default": "./dist/pure.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"jsnext:main": "dist/stripe.mjs",
|
|
9
19
|
"types": "types/index.d.ts",
|
|
10
20
|
"typings": "types/index.d.ts",
|
|
11
21
|
"scripts": {
|
|
@@ -31,10 +41,11 @@
|
|
|
31
41
|
"files": [
|
|
32
42
|
"dist",
|
|
33
43
|
"src",
|
|
34
|
-
"types"
|
|
35
|
-
"pure.js",
|
|
36
|
-
"pure.d.ts"
|
|
44
|
+
"types"
|
|
37
45
|
],
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=12.16"
|
|
48
|
+
},
|
|
38
49
|
"devDependencies": {
|
|
39
50
|
"@babel/core": "^7.7.2",
|
|
40
51
|
"@babel/preset-env": "^7.7.1",
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
StripeElementClasses,
|
|
5
5
|
StripeElementChangeEvent,
|
|
6
6
|
} from './base';
|
|
7
|
+
import {CardNetworkBrand} from '../elements-group';
|
|
7
8
|
|
|
8
9
|
export type StripeCardNumberElement = StripeElementBase & {
|
|
9
10
|
/**
|
|
@@ -109,7 +110,7 @@ export type StripeCardNumberElement = StripeElementBase & {
|
|
|
109
110
|
* The styles of an `Element` can be dynamically changed using `element.update`.
|
|
110
111
|
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
|
|
111
112
|
*/
|
|
112
|
-
update(options: Partial<
|
|
113
|
+
update(options: Partial<StripeCardNumberElementUpdateOptions>): void;
|
|
113
114
|
};
|
|
114
115
|
|
|
115
116
|
export interface StripeCardNumberElementOptions {
|
|
@@ -121,7 +122,47 @@ export interface StripeCardNumberElementOptions {
|
|
|
121
122
|
|
|
122
123
|
/**
|
|
123
124
|
* Applies a disabled state to the Element such that user input is not accepted.
|
|
124
|
-
* Default is false
|
|
125
|
+
* Default is `false`.
|
|
126
|
+
*/
|
|
127
|
+
disabled?: boolean;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Show a card brand icon in the Element.
|
|
131
|
+
* Default is `false`.
|
|
132
|
+
*/
|
|
133
|
+
showIcon?: boolean;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Appearance of the brand icon in the Element.
|
|
137
|
+
*/
|
|
138
|
+
iconStyle?: 'default' | 'solid';
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Hides and disables the Link Button in the Card Element.
|
|
142
|
+
* Default is `false`.
|
|
143
|
+
*/
|
|
144
|
+
disableLink?: boolean;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Specifies a network preference for Card Brand Choice. The first network in the array which is a valid
|
|
148
|
+
* network on the entered card will be selected as the default in the Card Brand Choice dropdown upon
|
|
149
|
+
* entry of a co-branded card.
|
|
150
|
+
*
|
|
151
|
+
* Default is an empty array, meaning no default selection will be made in the Card Brand choice dropdown.
|
|
152
|
+
*/
|
|
153
|
+
preferredNetwork?: Array<CardNetworkBrand>;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface StripeCardNumberElementUpdateOptions {
|
|
157
|
+
classes?: StripeElementClasses;
|
|
158
|
+
|
|
159
|
+
style?: StripeElementStyle;
|
|
160
|
+
|
|
161
|
+
placeholder?: string;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Applies a disabled state to the Element such that user input is not accepted.
|
|
165
|
+
* Default is `false`.
|
|
125
166
|
*/
|
|
126
167
|
disabled?: boolean;
|
|
127
168
|
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
StripeElementClasses,
|
|
5
5
|
StripeElementChangeEvent,
|
|
6
6
|
} from './base';
|
|
7
|
+
import {CardNetworkBrand} from '../elements-group';
|
|
7
8
|
|
|
8
9
|
export type StripeCardElement = StripeElementBase & {
|
|
9
10
|
/**
|
|
@@ -143,15 +144,24 @@ export interface StripeCardElementOptions {
|
|
|
143
144
|
|
|
144
145
|
/**
|
|
145
146
|
* Applies a disabled state to the Element such that user input is not accepted.
|
|
146
|
-
* Default is false
|
|
147
|
+
* Default is `false`.
|
|
147
148
|
*/
|
|
148
149
|
disabled?: boolean;
|
|
149
150
|
|
|
150
151
|
/**
|
|
151
152
|
* Hides and disables the Link Button in the Card Element.
|
|
152
|
-
* Default is false
|
|
153
|
+
* Default is `false`.
|
|
153
154
|
*/
|
|
154
155
|
disableLink?: boolean;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Specifies a network preference for Card Brand Choice. The first network in the array which is a valid
|
|
159
|
+
* network on the entered card will be selected as the default in the Card Brand Choice dropdown upon
|
|
160
|
+
* entry of a co-branded card.
|
|
161
|
+
*
|
|
162
|
+
* Default is an empty array, meaning no default selection will be made in the Card Brand choice dropdown.
|
|
163
|
+
*/
|
|
164
|
+
preferredNetwork?: Array<CardNetworkBrand>;
|
|
155
165
|
}
|
|
156
166
|
|
|
157
167
|
export interface StripeCardElementUpdateOptions {
|
|
@@ -185,7 +195,7 @@ export interface StripeCardElementUpdateOptions {
|
|
|
185
195
|
|
|
186
196
|
/**
|
|
187
197
|
* Applies a disabled state to the Element such that user input is not accepted.
|
|
188
|
-
* Default is false
|
|
198
|
+
* Default is `false`.
|
|
189
199
|
*/
|
|
190
200
|
disabled?: boolean;
|
|
191
201
|
}
|
|
@@ -617,6 +617,26 @@ export type StripeElementLocale =
|
|
|
617
617
|
| 'zh-HK'
|
|
618
618
|
| 'zh-TW';
|
|
619
619
|
|
|
620
|
+
export type CardNetworkBrand =
|
|
621
|
+
| 'accel'
|
|
622
|
+
| 'amex'
|
|
623
|
+
| 'carnet'
|
|
624
|
+
| 'cartes_bancaires'
|
|
625
|
+
| 'diners'
|
|
626
|
+
| 'discover'
|
|
627
|
+
| 'eftpos_au'
|
|
628
|
+
| 'elo'
|
|
629
|
+
| 'girocard'
|
|
630
|
+
| 'interac'
|
|
631
|
+
| 'jcb'
|
|
632
|
+
| 'mastercard'
|
|
633
|
+
| 'nyce'
|
|
634
|
+
| 'pulse'
|
|
635
|
+
| 'rupay'
|
|
636
|
+
| 'star'
|
|
637
|
+
| 'unionpay'
|
|
638
|
+
| 'visa';
|
|
639
|
+
|
|
620
640
|
type PaymentMethodOptions = {
|
|
621
641
|
card?: {require_cvc_recollection?: boolean};
|
|
622
642
|
us_bank_account?: {
|
package/pure.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./dist/pure.js');
|
|
File without changes
|