@stripe/stripe-js 6.1.0 → 7.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 +3 -3
- package/dist/index.mjs +3 -3
- package/dist/pure.js +3 -3
- package/dist/pure.mjs +3 -3
- package/dist/stripe-js/checkout.d.mts +12 -10
- package/dist/stripe-js/checkout.d.ts +12 -10
- package/dist/stripe-js/stripe.d.mts +9 -0
- package/dist/stripe-js/stripe.d.ts +9 -0
- package/package.json +1 -1
- package/src/shared.ts +1 -1
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ pinned versions are as follows:
|
|
|
40
40
|
| --------------------- | ------------- |
|
|
41
41
|
| <6 | v3 |
|
|
42
42
|
| v6 | acacia |
|
|
43
|
+
| v7 | basil |
|
|
43
44
|
|
|
44
45
|
## Usage
|
|
45
46
|
|
|
@@ -122,7 +123,7 @@ one. When you call `loadStripe`, it will use the existing script tag.
|
|
|
122
123
|
|
|
123
124
|
```html
|
|
124
125
|
<!-- Somewhere in your site's <head> -->
|
|
125
|
-
<script src="https://js.stripe.com/
|
|
126
|
+
<script src="https://js.stripe.com/basil/stripe.js" async></script>
|
|
126
127
|
```
|
|
127
128
|
|
|
128
129
|
### Importing `loadStripe` without side effects
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var RELEASE_TRAIN = '
|
|
5
|
+
var RELEASE_TRAIN = 'basil';
|
|
6
6
|
|
|
7
7
|
var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion(version) {
|
|
8
8
|
return version === 3 ? 'v3' : version;
|
|
@@ -55,7 +55,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
55
55
|
|
|
56
56
|
stripe._registerWrapper({
|
|
57
57
|
name: 'stripe-js',
|
|
58
|
-
version: "
|
|
58
|
+
version: "7.0.0",
|
|
59
59
|
startTime: startTime
|
|
60
60
|
});
|
|
61
61
|
};
|
|
@@ -151,7 +151,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
|
151
151
|
var expectedVersion = RELEASE_TRAIN;
|
|
152
152
|
|
|
153
153
|
if (isTestKey && version !== expectedVersion) {
|
|
154
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("
|
|
154
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.0.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
var stripe = maybeStripe.apply(undefined, args);
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var RELEASE_TRAIN = '
|
|
1
|
+
var RELEASE_TRAIN = 'basil';
|
|
2
2
|
|
|
3
3
|
var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion(version) {
|
|
4
4
|
return version === 3 ? 'v3' : version;
|
|
@@ -51,7 +51,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
51
51
|
|
|
52
52
|
stripe._registerWrapper({
|
|
53
53
|
name: 'stripe-js',
|
|
54
|
-
version: "
|
|
54
|
+
version: "7.0.0",
|
|
55
55
|
startTime: startTime
|
|
56
56
|
});
|
|
57
57
|
};
|
|
@@ -147,7 +147,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
|
147
147
|
var expectedVersion = RELEASE_TRAIN;
|
|
148
148
|
|
|
149
149
|
if (isTestKey && version !== expectedVersion) {
|
|
150
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("
|
|
150
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.0.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
var stripe = maybeStripe.apply(undefined, args);
|
package/dist/pure.js
CHANGED
|
@@ -18,7 +18,7 @@ function _typeof(obj) {
|
|
|
18
18
|
return _typeof(obj);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
var RELEASE_TRAIN = '
|
|
21
|
+
var RELEASE_TRAIN = 'basil';
|
|
22
22
|
|
|
23
23
|
var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion(version) {
|
|
24
24
|
return version === 3 ? 'v3' : version;
|
|
@@ -71,7 +71,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
71
71
|
|
|
72
72
|
stripe._registerWrapper({
|
|
73
73
|
name: 'stripe-js',
|
|
74
|
-
version: "
|
|
74
|
+
version: "7.0.0",
|
|
75
75
|
startTime: startTime
|
|
76
76
|
});
|
|
77
77
|
};
|
|
@@ -167,7 +167,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
|
167
167
|
var expectedVersion = RELEASE_TRAIN;
|
|
168
168
|
|
|
169
169
|
if (isTestKey && version !== expectedVersion) {
|
|
170
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("
|
|
170
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.0.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
var stripe = maybeStripe.apply(undefined, args);
|
package/dist/pure.mjs
CHANGED
|
@@ -14,7 +14,7 @@ function _typeof(obj) {
|
|
|
14
14
|
return _typeof(obj);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
var RELEASE_TRAIN = '
|
|
17
|
+
var RELEASE_TRAIN = 'basil';
|
|
18
18
|
|
|
19
19
|
var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion(version) {
|
|
20
20
|
return version === 3 ? 'v3' : version;
|
|
@@ -67,7 +67,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
67
67
|
|
|
68
68
|
stripe._registerWrapper({
|
|
69
69
|
name: 'stripe-js',
|
|
70
|
-
version: "
|
|
70
|
+
version: "7.0.0",
|
|
71
71
|
startTime: startTime
|
|
72
72
|
});
|
|
73
73
|
};
|
|
@@ -163,7 +163,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
|
163
163
|
var expectedVersion = RELEASE_TRAIN;
|
|
164
164
|
|
|
165
165
|
if (isTestKey && version !== expectedVersion) {
|
|
166
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("
|
|
166
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.0.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
var stripe = maybeStripe.apply(undefined, args);
|
|
@@ -69,10 +69,12 @@ export type StripeCheckoutDiscountAmount = StripeCheckoutAmount & {
|
|
|
69
69
|
| {type: 'forever'}
|
|
70
70
|
| {type: 'repeating'; durationInMonths: number}
|
|
71
71
|
| null;
|
|
72
|
+
percentOff: number | null;
|
|
72
73
|
};
|
|
73
74
|
|
|
74
75
|
export type StripeCheckoutDueNext = {
|
|
75
76
|
subtotal: StripeCheckoutAmount;
|
|
77
|
+
total: StripeCheckoutAmount;
|
|
76
78
|
discount: StripeCheckoutAmount;
|
|
77
79
|
taxInclusive: StripeCheckoutAmount;
|
|
78
80
|
taxExclusive: StripeCheckoutAmount;
|
|
@@ -480,41 +482,41 @@ type ApplyPromotionCodeError =
|
|
|
480
482
|
| {message: string; code: 'invalidCode'}
|
|
481
483
|
| AnyBuyerError;
|
|
482
484
|
export type StripeCheckoutApplyPromotionCodeResult =
|
|
483
|
-
| {type: 'success';
|
|
485
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
484
486
|
| {type: 'error'; error: ApplyPromotionCodeError};
|
|
485
487
|
|
|
486
488
|
export type StripeCheckoutRemovePromotionCodeResult =
|
|
487
|
-
| {type: 'success';
|
|
489
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
488
490
|
| {type: 'error'; error: AnyBuyerError};
|
|
489
491
|
|
|
490
492
|
export type StripeCheckoutUpdateAddressResult =
|
|
491
|
-
| {type: 'success';
|
|
493
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
492
494
|
| {type: 'error'; error: AnyBuyerError};
|
|
493
495
|
|
|
494
496
|
export type StripeCheckoutUpdatePhoneNumberResult =
|
|
495
|
-
| {type: 'success';
|
|
497
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
496
498
|
| {type: 'error'; error: never};
|
|
497
499
|
|
|
498
500
|
type UpdateEmailError =
|
|
499
501
|
| {message: string; code: 'incompleteEmail'}
|
|
500
502
|
| {message: string; code: 'invalidEmail'};
|
|
501
503
|
export type StripeCheckoutUpdateEmailResult =
|
|
502
|
-
| {type: 'success';
|
|
504
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
503
505
|
| {type: 'error'; error: UpdateEmailError};
|
|
504
506
|
|
|
505
507
|
export type StripeCheckoutUpdateLineItemQuantityResult =
|
|
506
|
-
| {type: 'success';
|
|
508
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
507
509
|
| {type: 'error'; error: AnyBuyerError};
|
|
508
510
|
|
|
509
511
|
export type StripeCheckoutUpdateShippingOptionResult =
|
|
510
|
-
| {type: 'success';
|
|
512
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
511
513
|
| {type: 'error'; error: AnyBuyerError};
|
|
512
514
|
|
|
513
515
|
type UpdateTaxIdInfoError =
|
|
514
516
|
| {message: string; code: 'invalidTaxId'}
|
|
515
517
|
| AnyBuyerError;
|
|
516
518
|
export type StripeCheckoutUpdateTaxIdInfoResult =
|
|
517
|
-
| {type: 'success';
|
|
519
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
518
520
|
| {type: 'error'; error: UpdateTaxIdInfoError};
|
|
519
521
|
|
|
520
522
|
type ConfirmError =
|
|
@@ -527,12 +529,12 @@ type ConfirmError =
|
|
|
527
529
|
}
|
|
528
530
|
| AnyBuyerError;
|
|
529
531
|
export type StripeCheckoutConfirmResult =
|
|
530
|
-
| {type: 'success';
|
|
532
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
531
533
|
| {type: 'error'; error: ConfirmError};
|
|
532
534
|
|
|
533
535
|
type RunServerUpdateFunction = () => Promise<unknown>;
|
|
534
536
|
export type StripeCheckoutRunServerUpdateResult =
|
|
535
|
-
| {type: 'success';
|
|
537
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
536
538
|
| {type: 'error'; error: AnyBuyerError};
|
|
537
539
|
|
|
538
540
|
export interface StripeCheckout {
|
|
@@ -69,10 +69,12 @@ export type StripeCheckoutDiscountAmount = StripeCheckoutAmount & {
|
|
|
69
69
|
| {type: 'forever'}
|
|
70
70
|
| {type: 'repeating'; durationInMonths: number}
|
|
71
71
|
| null;
|
|
72
|
+
percentOff: number | null;
|
|
72
73
|
};
|
|
73
74
|
|
|
74
75
|
export type StripeCheckoutDueNext = {
|
|
75
76
|
subtotal: StripeCheckoutAmount;
|
|
77
|
+
total: StripeCheckoutAmount;
|
|
76
78
|
discount: StripeCheckoutAmount;
|
|
77
79
|
taxInclusive: StripeCheckoutAmount;
|
|
78
80
|
taxExclusive: StripeCheckoutAmount;
|
|
@@ -480,41 +482,41 @@ type ApplyPromotionCodeError =
|
|
|
480
482
|
| {message: string; code: 'invalidCode'}
|
|
481
483
|
| AnyBuyerError;
|
|
482
484
|
export type StripeCheckoutApplyPromotionCodeResult =
|
|
483
|
-
| {type: 'success';
|
|
485
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
484
486
|
| {type: 'error'; error: ApplyPromotionCodeError};
|
|
485
487
|
|
|
486
488
|
export type StripeCheckoutRemovePromotionCodeResult =
|
|
487
|
-
| {type: 'success';
|
|
489
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
488
490
|
| {type: 'error'; error: AnyBuyerError};
|
|
489
491
|
|
|
490
492
|
export type StripeCheckoutUpdateAddressResult =
|
|
491
|
-
| {type: 'success';
|
|
493
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
492
494
|
| {type: 'error'; error: AnyBuyerError};
|
|
493
495
|
|
|
494
496
|
export type StripeCheckoutUpdatePhoneNumberResult =
|
|
495
|
-
| {type: 'success';
|
|
497
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
496
498
|
| {type: 'error'; error: never};
|
|
497
499
|
|
|
498
500
|
type UpdateEmailError =
|
|
499
501
|
| {message: string; code: 'incompleteEmail'}
|
|
500
502
|
| {message: string; code: 'invalidEmail'};
|
|
501
503
|
export type StripeCheckoutUpdateEmailResult =
|
|
502
|
-
| {type: 'success';
|
|
504
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
503
505
|
| {type: 'error'; error: UpdateEmailError};
|
|
504
506
|
|
|
505
507
|
export type StripeCheckoutUpdateLineItemQuantityResult =
|
|
506
|
-
| {type: 'success';
|
|
508
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
507
509
|
| {type: 'error'; error: AnyBuyerError};
|
|
508
510
|
|
|
509
511
|
export type StripeCheckoutUpdateShippingOptionResult =
|
|
510
|
-
| {type: 'success';
|
|
512
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
511
513
|
| {type: 'error'; error: AnyBuyerError};
|
|
512
514
|
|
|
513
515
|
type UpdateTaxIdInfoError =
|
|
514
516
|
| {message: string; code: 'invalidTaxId'}
|
|
515
517
|
| AnyBuyerError;
|
|
516
518
|
export type StripeCheckoutUpdateTaxIdInfoResult =
|
|
517
|
-
| {type: 'success';
|
|
519
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
518
520
|
| {type: 'error'; error: UpdateTaxIdInfoError};
|
|
519
521
|
|
|
520
522
|
type ConfirmError =
|
|
@@ -527,12 +529,12 @@ type ConfirmError =
|
|
|
527
529
|
}
|
|
528
530
|
| AnyBuyerError;
|
|
529
531
|
export type StripeCheckoutConfirmResult =
|
|
530
|
-
| {type: 'success';
|
|
532
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
531
533
|
| {type: 'error'; error: ConfirmError};
|
|
532
534
|
|
|
533
535
|
type RunServerUpdateFunction = () => Promise<unknown>;
|
|
534
536
|
export type StripeCheckoutRunServerUpdateResult =
|
|
535
|
-
| {type: 'success';
|
|
537
|
+
| {type: 'success'; session: StripeCheckoutSession}
|
|
536
538
|
| {type: 'error'; error: AnyBuyerError};
|
|
537
539
|
|
|
538
540
|
export interface StripeCheckout {
|
|
@@ -1430,6 +1430,15 @@ export interface StripeConstructorOptions {
|
|
|
1430
1430
|
* Most users of Stripe.js do not pass this option.
|
|
1431
1431
|
*/
|
|
1432
1432
|
betas?: string[];
|
|
1433
|
+
|
|
1434
|
+
/**
|
|
1435
|
+
* Stripe.js developer tooling [options](https://docs.corp.stripe.com/js/initializing#init_stripe_js-options-developerTools).
|
|
1436
|
+
*/
|
|
1437
|
+
developerTools?: {
|
|
1438
|
+
assistant?: {
|
|
1439
|
+
enabled?: boolean;
|
|
1440
|
+
};
|
|
1441
|
+
};
|
|
1433
1442
|
}
|
|
1434
1443
|
|
|
1435
1444
|
export type StripeErrorType =
|
|
@@ -1430,6 +1430,15 @@ export interface StripeConstructorOptions {
|
|
|
1430
1430
|
* Most users of Stripe.js do not pass this option.
|
|
1431
1431
|
*/
|
|
1432
1432
|
betas?: string[];
|
|
1433
|
+
|
|
1434
|
+
/**
|
|
1435
|
+
* Stripe.js developer tooling [options](https://docs.corp.stripe.com/js/initializing#init_stripe_js-options-developerTools).
|
|
1436
|
+
*/
|
|
1437
|
+
developerTools?: {
|
|
1438
|
+
assistant?: {
|
|
1439
|
+
enabled?: boolean;
|
|
1440
|
+
};
|
|
1441
|
+
};
|
|
1433
1442
|
}
|
|
1434
1443
|
|
|
1435
1444
|
export type StripeErrorType =
|
package/package.json
CHANGED
package/src/shared.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface LoadParams {
|
|
|
12
12
|
// containing the package.json version
|
|
13
13
|
declare const _VERSION: string;
|
|
14
14
|
|
|
15
|
-
export const RELEASE_TRAIN = '
|
|
15
|
+
export const RELEASE_TRAIN = 'basil';
|
|
16
16
|
|
|
17
17
|
const runtimeVersionToUrlVersion = (version: string | number) =>
|
|
18
18
|
version === 3 ? 'v3' : version;
|