@stripe/stripe-js 9.0.0-rc.2 → 9.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 +2 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/pure.js +2 -2
- package/dist/pure.mjs +2 -2
- package/dist/stripe-js/elements/payment-form.d.mts +17 -1
- package/dist/stripe-js/elements/payment-form.d.ts +17 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -42,6 +42,7 @@ pinned versions are as follows:
|
|
|
42
42
|
| v6 | acacia |
|
|
43
43
|
| v7 | basil |
|
|
44
44
|
| v8 | clover |
|
|
45
|
+
| v9 | dahlia |
|
|
45
46
|
|
|
46
47
|
## Usage
|
|
47
48
|
|
|
@@ -124,7 +125,7 @@ one. When you call `loadStripe`, it will use the existing script tag.
|
|
|
124
125
|
|
|
125
126
|
```html
|
|
126
127
|
<!-- Somewhere in your site's <head> -->
|
|
127
|
-
<script src="https://js.stripe.com/
|
|
128
|
+
<script src="https://js.stripe.com/dahlia/stripe.js" async></script>
|
|
128
129
|
```
|
|
129
130
|
|
|
130
131
|
### Importing `loadStripe` without side effects
|
package/dist/index.js
CHANGED
|
@@ -71,7 +71,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
71
71
|
|
|
72
72
|
stripe._registerWrapper({
|
|
73
73
|
name: 'stripe-js',
|
|
74
|
-
version: "9.0.0
|
|
74
|
+
version: "9.0.0",
|
|
75
75
|
startTime: startTime
|
|
76
76
|
});
|
|
77
77
|
};
|
|
@@ -172,7 +172,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
|
172
172
|
var expectedVersion = RELEASE_TRAIN;
|
|
173
173
|
|
|
174
174
|
if (isTestKey && version !== expectedVersion) {
|
|
175
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.0.0
|
|
175
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.0.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
var stripe = maybeStripe.apply(undefined, args);
|
package/dist/index.mjs
CHANGED
|
@@ -67,7 +67,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
67
67
|
|
|
68
68
|
stripe._registerWrapper({
|
|
69
69
|
name: 'stripe-js',
|
|
70
|
-
version: "9.0.0
|
|
70
|
+
version: "9.0.0",
|
|
71
71
|
startTime: startTime
|
|
72
72
|
});
|
|
73
73
|
};
|
|
@@ -168,7 +168,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
|
168
168
|
var expectedVersion = RELEASE_TRAIN;
|
|
169
169
|
|
|
170
170
|
if (isTestKey && version !== expectedVersion) {
|
|
171
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.0.0
|
|
171
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.0.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
var stripe = maybeStripe.apply(undefined, args);
|
package/dist/pure.js
CHANGED
|
@@ -71,7 +71,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
71
71
|
|
|
72
72
|
stripe._registerWrapper({
|
|
73
73
|
name: 'stripe-js',
|
|
74
|
-
version: "9.0.0
|
|
74
|
+
version: "9.0.0",
|
|
75
75
|
startTime: startTime
|
|
76
76
|
});
|
|
77
77
|
};
|
|
@@ -172,7 +172,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
|
172
172
|
var expectedVersion = RELEASE_TRAIN;
|
|
173
173
|
|
|
174
174
|
if (isTestKey && version !== expectedVersion) {
|
|
175
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.0.0
|
|
175
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.0.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
var stripe = maybeStripe.apply(undefined, args);
|
package/dist/pure.mjs
CHANGED
|
@@ -67,7 +67,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
67
67
|
|
|
68
68
|
stripe._registerWrapper({
|
|
69
69
|
name: 'stripe-js',
|
|
70
|
-
version: "9.0.0
|
|
70
|
+
version: "9.0.0",
|
|
71
71
|
startTime: startTime
|
|
72
72
|
});
|
|
73
73
|
};
|
|
@@ -168,7 +168,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
|
168
168
|
var expectedVersion = RELEASE_TRAIN;
|
|
169
169
|
|
|
170
170
|
if (isTestKey && version !== expectedVersion) {
|
|
171
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.0.0
|
|
171
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.0.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
var stripe = maybeStripe.apply(undefined, args);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {Omit} from '../../utils';
|
|
1
2
|
import {StripeError} from '../stripe';
|
|
2
3
|
import {StripeElementBase} from './base';
|
|
3
4
|
import {StripeExpressCheckoutElementConfirmEvent} from './express-checkout';
|
|
@@ -85,6 +86,12 @@ export interface StripeCheckoutFormChangeEvent {
|
|
|
85
86
|
} | null;
|
|
86
87
|
savePaymentMethod?: boolean;
|
|
87
88
|
};
|
|
89
|
+
adaptivePricing?: {
|
|
90
|
+
/**
|
|
91
|
+
* The currently selected local currency code (e.g. 'eur', 'gbp').
|
|
92
|
+
*/
|
|
93
|
+
currency: string;
|
|
94
|
+
};
|
|
88
95
|
};
|
|
89
96
|
|
|
90
97
|
/**
|
|
@@ -126,6 +133,15 @@ interface StripeCheckoutFormPayButtonConfirmEvent {
|
|
|
126
133
|
paymentMethodType: string | null;
|
|
127
134
|
}
|
|
128
135
|
|
|
136
|
+
/**
|
|
137
|
+
* The value returned by `checkoutForm.getValue()`.
|
|
138
|
+
* Same shape as the change event payload, but without `elementType`.
|
|
139
|
+
*/
|
|
140
|
+
export type StripeCheckoutFormValue = Omit<
|
|
141
|
+
StripeCheckoutFormChangeEvent,
|
|
142
|
+
'elementType'
|
|
143
|
+
>;
|
|
144
|
+
|
|
129
145
|
/**
|
|
130
146
|
* The confirm event payload for the CheckoutForm.
|
|
131
147
|
*/
|
|
@@ -281,7 +297,7 @@ export type StripeCheckoutForm = StripeElementBase & {
|
|
|
281
297
|
/**
|
|
282
298
|
* Retrieves the current form values from the CheckoutForm.
|
|
283
299
|
*/
|
|
284
|
-
getValue(): Promise<
|
|
300
|
+
getValue(): Promise<StripeCheckoutFormValue>;
|
|
285
301
|
|
|
286
302
|
/**
|
|
287
303
|
* Navigates to the view at the given index (from the change event's views array).
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {Omit} from '../../utils';
|
|
1
2
|
import {StripeError} from '../stripe';
|
|
2
3
|
import {StripeElementBase} from './base';
|
|
3
4
|
import {StripeExpressCheckoutElementConfirmEvent} from './express-checkout';
|
|
@@ -85,6 +86,12 @@ export interface StripeCheckoutFormChangeEvent {
|
|
|
85
86
|
} | null;
|
|
86
87
|
savePaymentMethod?: boolean;
|
|
87
88
|
};
|
|
89
|
+
adaptivePricing?: {
|
|
90
|
+
/**
|
|
91
|
+
* The currently selected local currency code (e.g. 'eur', 'gbp').
|
|
92
|
+
*/
|
|
93
|
+
currency: string;
|
|
94
|
+
};
|
|
88
95
|
};
|
|
89
96
|
|
|
90
97
|
/**
|
|
@@ -126,6 +133,15 @@ interface StripeCheckoutFormPayButtonConfirmEvent {
|
|
|
126
133
|
paymentMethodType: string | null;
|
|
127
134
|
}
|
|
128
135
|
|
|
136
|
+
/**
|
|
137
|
+
* The value returned by `checkoutForm.getValue()`.
|
|
138
|
+
* Same shape as the change event payload, but without `elementType`.
|
|
139
|
+
*/
|
|
140
|
+
export type StripeCheckoutFormValue = Omit<
|
|
141
|
+
StripeCheckoutFormChangeEvent,
|
|
142
|
+
'elementType'
|
|
143
|
+
>;
|
|
144
|
+
|
|
129
145
|
/**
|
|
130
146
|
* The confirm event payload for the CheckoutForm.
|
|
131
147
|
*/
|
|
@@ -281,7 +297,7 @@ export type StripeCheckoutForm = StripeElementBase & {
|
|
|
281
297
|
/**
|
|
282
298
|
* Retrieves the current form values from the CheckoutForm.
|
|
283
299
|
*/
|
|
284
|
-
getValue(): Promise<
|
|
300
|
+
getValue(): Promise<StripeCheckoutFormValue>;
|
|
285
301
|
|
|
286
302
|
/**
|
|
287
303
|
* Navigates to the view at the given index (from the change event's views array).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-js",
|
|
3
|
-
"version": "9.0.0
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Stripe.js loading utility",
|
|
5
5
|
"repository": "github:stripe/stripe-js",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"jsnext:main": "lib/index.mjs",
|
|
9
9
|
"types": "lib/index.d.ts",
|
|
10
10
|
"typings": "lib/index.d.ts",
|
|
11
|
-
"releaseCandidate":
|
|
11
|
+
"releaseCandidate": false,
|
|
12
12
|
"scripts": {
|
|
13
13
|
"test": "yarn lint && yarn test:unit && yarn test:package-types && yarn test:types && yarn typecheck",
|
|
14
14
|
"test:unit": "jest",
|