@lightspeed/online-payments-sdk 1.8.0 → 1.9.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 +37 -0
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/v1/EventBroadcaster.js +1 -0
- package/dist/cjs/v1/stripe/localizedText.js +32 -0
- package/dist/cjs/v1/stripe/session.js +9 -0
- package/dist/cjs/v1/stripe/shared.js +55 -14
- package/dist/cjs/v1/stripe/terms.js +1 -1
- package/dist/cjs/v1/stripe/themes.js +2 -2
- package/dist/cjs/v1/stripe/widget.js +64 -25
- package/dist/cjs/v1/stripe/widgets/deferredMoto.js +203 -0
- package/dist/cjs/v1/widget.js +32 -4
- package/dist/cjs/version.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/v1/EventBroadcaster.d.ts +18 -1
- package/dist/v1/EventBroadcaster.js +1 -0
- package/dist/v1/common.d.ts +8 -2
- package/dist/v1/index.d.ts +2 -2
- package/dist/v1/stripe/localizedText.d.ts +3 -0
- package/dist/v1/stripe/localizedText.js +28 -0
- package/dist/v1/stripe/session.d.ts +29 -6
- package/dist/v1/stripe/session.js +7 -1
- package/dist/v1/stripe/shared.d.ts +8 -5
- package/dist/v1/stripe/shared.js +55 -15
- package/dist/v1/stripe/terms.d.ts +1 -1
- package/dist/v1/stripe/terms.js +1 -1
- package/dist/v1/stripe/themes.js +2 -2
- package/dist/v1/stripe/widget.js +62 -23
- package/dist/v1/stripe/widgets/deferredMoto.d.ts +5 -0
- package/dist/v1/stripe/widgets/deferredMoto.js +200 -0
- package/dist/v1/stripe/widgets/moto.d.ts +2 -2
- package/dist/v1/stripe/widgets/payment.d.ts +2 -2
- package/dist/v1/widget.js +32 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -3
- package/styles/lightspeed-global-styles.css +81 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { ProcessingError } from '../../error';
|
|
38
|
+
import { EventBuilder } from '../ResultBuilder';
|
|
39
|
+
import { getCardDeclinedText } from '../localizedText';
|
|
40
|
+
import { cleanupElements, createPaymentElement, createPaymentElementOptions, createSavePaymentMethodElement, initStripe, setupChangeEventHandler, } from '../shared';
|
|
41
|
+
function publishStripeError(error, eventBroadcaster) {
|
|
42
|
+
return eventBroadcaster.publish(EventBuilder.fromStripeError(error));
|
|
43
|
+
}
|
|
44
|
+
export function mountDeferredMotoWidget(mountElement, session, eventBroadcaster, defaultValues, theme) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
+
var _a, stripe, elements, paymentOptions, _b, paymentElement, paymentContainer, customTermsContainer, finalizationError, savePaymentMethod, revision, unmounted, completedSubmission, clearFinalizationError, invalidateSubmission, hasSaveOption, updateSaveCheckboxState, savePaymentMethodContainer, submission, failSubmission, submit;
|
|
47
|
+
var _this = this;
|
|
48
|
+
return __generator(this, function (_c) {
|
|
49
|
+
switch (_c.label) {
|
|
50
|
+
case 0: return [4 /*yield*/, initStripe(session.context, theme)];
|
|
51
|
+
case 1:
|
|
52
|
+
_a = _c.sent(), stripe = _a.stripe, elements = _a.elements;
|
|
53
|
+
paymentOptions = createPaymentElementOptions(defaultValues, theme, false, session.context.businessName);
|
|
54
|
+
_b = createPaymentElement(elements, paymentOptions, mountElement, eventBroadcaster), paymentElement = _b.element, paymentContainer = _b.container, customTermsContainer = _b.customTermsContainer;
|
|
55
|
+
finalizationError = document.createElement('p');
|
|
56
|
+
finalizationError.className = 'stripe-finalization-error';
|
|
57
|
+
finalizationError.setAttribute('role', 'alert');
|
|
58
|
+
finalizationError.hidden = true;
|
|
59
|
+
paymentContainer.insertAdjacentElement('afterend', finalizationError);
|
|
60
|
+
savePaymentMethod = false;
|
|
61
|
+
revision = 0;
|
|
62
|
+
unmounted = false;
|
|
63
|
+
clearFinalizationError = function () {
|
|
64
|
+
finalizationError.hidden = true;
|
|
65
|
+
finalizationError.textContent = '';
|
|
66
|
+
};
|
|
67
|
+
invalidateSubmission = function () {
|
|
68
|
+
revision += 1;
|
|
69
|
+
completedSubmission = undefined;
|
|
70
|
+
clearFinalizationError();
|
|
71
|
+
};
|
|
72
|
+
hasSaveOption = session.metadata.sessionType === 'moto-with-save';
|
|
73
|
+
updateSaveCheckboxState = setupChangeEventHandler(paymentElement, eventBroadcaster, null, invalidateSubmission, hasSaveOption ? false : undefined);
|
|
74
|
+
if (hasSaveOption) {
|
|
75
|
+
savePaymentMethodContainer = createSavePaymentMethodElement(mountElement, function (checked) {
|
|
76
|
+
savePaymentMethod = checked;
|
|
77
|
+
invalidateSubmission();
|
|
78
|
+
updateSaveCheckboxState(savePaymentMethod);
|
|
79
|
+
}, session.context.locale);
|
|
80
|
+
}
|
|
81
|
+
failSubmission = function (message) {
|
|
82
|
+
eventBroadcaster.publish({ status: 'Error', code: 'Processing' });
|
|
83
|
+
throw new ProcessingError(message);
|
|
84
|
+
};
|
|
85
|
+
submit = function () {
|
|
86
|
+
if (unmounted) {
|
|
87
|
+
eventBroadcaster.publish({ status: 'Error', code: 'Processing' });
|
|
88
|
+
return Promise.reject(new ProcessingError('The payment widget has been unmounted'));
|
|
89
|
+
}
|
|
90
|
+
if ((completedSubmission === null || completedSubmission === void 0 ? void 0 : completedSubmission.revision) === revision) {
|
|
91
|
+
return Promise.resolve(completedSubmission.result);
|
|
92
|
+
}
|
|
93
|
+
if (submission) {
|
|
94
|
+
if (submission.revision === revision) {
|
|
95
|
+
return submission.promise;
|
|
96
|
+
}
|
|
97
|
+
return submission.promise.then(submit, submit);
|
|
98
|
+
}
|
|
99
|
+
var submissionRevision = revision;
|
|
100
|
+
var submissionSavePaymentMethod = savePaymentMethod;
|
|
101
|
+
clearFinalizationError();
|
|
102
|
+
var assertSubmissionIsCurrent = function () {
|
|
103
|
+
if (unmounted) {
|
|
104
|
+
return failSubmission('The payment widget was unmounted during submission');
|
|
105
|
+
}
|
|
106
|
+
if (revision !== submissionRevision) {
|
|
107
|
+
return failSubmission('Payment details or save consent changed during submission');
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
var promise = (function () { return __awaiter(_this, void 0, void 0, function () {
|
|
111
|
+
var submitResult, paymentMethodResult, result;
|
|
112
|
+
var _a;
|
|
113
|
+
return __generator(this, function (_b) {
|
|
114
|
+
switch (_b.label) {
|
|
115
|
+
case 0: return [4 /*yield*/, elements.submit()];
|
|
116
|
+
case 1:
|
|
117
|
+
submitResult = _b.sent();
|
|
118
|
+
assertSubmissionIsCurrent();
|
|
119
|
+
if (submitResult.error) {
|
|
120
|
+
return [2 /*return*/, publishStripeError(submitResult.error, eventBroadcaster)];
|
|
121
|
+
}
|
|
122
|
+
return [4 /*yield*/, stripe.createPaymentMethod({ elements: elements })];
|
|
123
|
+
case 2:
|
|
124
|
+
paymentMethodResult = _b.sent();
|
|
125
|
+
assertSubmissionIsCurrent();
|
|
126
|
+
if (paymentMethodResult.error) {
|
|
127
|
+
return [2 /*return*/, publishStripeError(paymentMethodResult.error, eventBroadcaster)];
|
|
128
|
+
}
|
|
129
|
+
if (!((_a = paymentMethodResult.paymentMethod) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
130
|
+
eventBroadcaster.publish({ status: 'Error', code: 'Unexpected' });
|
|
131
|
+
throw new ProcessingError('Stripe did not return a PaymentMethod ID');
|
|
132
|
+
}
|
|
133
|
+
result = {
|
|
134
|
+
status: 'RequiresFinalization',
|
|
135
|
+
code: 'RequiresFinalization',
|
|
136
|
+
finalizationRequest: {
|
|
137
|
+
paymentData: {
|
|
138
|
+
type: 'payment-method',
|
|
139
|
+
id: paymentMethodResult.paymentMethod.id,
|
|
140
|
+
},
|
|
141
|
+
options: {
|
|
142
|
+
savePaymentMethod: submissionSavePaymentMethod,
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
completedSubmission = { revision: submissionRevision, result: result };
|
|
147
|
+
return [2 /*return*/, result];
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}); })();
|
|
151
|
+
var currentSubmission = { revision: submissionRevision, promise: promise };
|
|
152
|
+
submission = currentSubmission;
|
|
153
|
+
var clearSubmission = function () {
|
|
154
|
+
if (submission === currentSubmission) {
|
|
155
|
+
submission = undefined;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
promise.then(clearSubmission, clearSubmission);
|
|
159
|
+
return promise;
|
|
160
|
+
};
|
|
161
|
+
return [2 /*return*/, {
|
|
162
|
+
unmount: function () {
|
|
163
|
+
if (unmounted) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
unmounted = true;
|
|
167
|
+
revision += 1;
|
|
168
|
+
completedSubmission = undefined;
|
|
169
|
+
cleanupElements(paymentElement, null, paymentContainer, null, customTermsContainer);
|
|
170
|
+
finalizationError.remove();
|
|
171
|
+
savePaymentMethodContainer === null || savePaymentMethodContainer === void 0 ? void 0 : savePaymentMethodContainer.remove();
|
|
172
|
+
},
|
|
173
|
+
submit: submit,
|
|
174
|
+
reportFinalizationDecline: function (result, message) {
|
|
175
|
+
if (unmounted ||
|
|
176
|
+
(completedSubmission === null || completedSubmission === void 0 ? void 0 : completedSubmission.revision) !== revision ||
|
|
177
|
+
completedSubmission.result.finalizationRequest.paymentData.type !==
|
|
178
|
+
result.finalizationRequest.paymentData.type ||
|
|
179
|
+
completedSubmission.result.finalizationRequest.paymentData.id !==
|
|
180
|
+
result.finalizationRequest.paymentData.id ||
|
|
181
|
+
completedSubmission.result.finalizationRequest.options
|
|
182
|
+
.savePaymentMethod !==
|
|
183
|
+
result.finalizationRequest.options.savePaymentMethod) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
invalidateSubmission();
|
|
187
|
+
var trimmedMessage = message.trim();
|
|
188
|
+
finalizationError.textContent =
|
|
189
|
+
trimmedMessage === 'Payment declined.' || !trimmedMessage
|
|
190
|
+
? getCardDeclinedText(session.context.locale)
|
|
191
|
+
: trimmedMessage;
|
|
192
|
+
finalizationError.hidden = false;
|
|
193
|
+
paymentElement.focus();
|
|
194
|
+
eventBroadcaster.publish({ status: 'Declined', code: 'Generic' });
|
|
195
|
+
},
|
|
196
|
+
}];
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IntentBoundStripeSession } from '../session';
|
|
2
2
|
import { DefaultValues, WidgetController } from '../../common';
|
|
3
3
|
import { EventBroadcaster } from '../../EventBroadcaster';
|
|
4
4
|
import { PaymentWidgetTheme } from '../../widget';
|
|
@@ -6,4 +6,4 @@ import { PaymentWidgetTheme } from '../../widget';
|
|
|
6
6
|
* Mount MOTO widget for moto and moto-with-save session types
|
|
7
7
|
* MOTO (Mail Order/Telephone Order) forms don't require address collection
|
|
8
8
|
*/
|
|
9
|
-
export declare function mountMotoWidget(mountElement: HTMLElement, session:
|
|
9
|
+
export declare function mountMotoWidget(mountElement: HTMLElement, session: IntentBoundStripeSession, eventBroadcaster: EventBroadcaster, defaultValues?: DefaultValues, theme?: PaymentWidgetTheme): Promise<WidgetController>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IntentBoundStripeSession } from '../session';
|
|
2
2
|
import { DefaultValues, WidgetController } from '../../common';
|
|
3
3
|
import { EventBroadcaster } from '../../EventBroadcaster';
|
|
4
4
|
import { PaymentWidgetTheme } from '../../widget';
|
|
5
5
|
/**
|
|
6
6
|
* Mount payment widget for payment and payment-with-save session types
|
|
7
7
|
*/
|
|
8
|
-
export declare function mountPaymentWidget(mountElement: HTMLElement, session:
|
|
8
|
+
export declare function mountPaymentWidget(mountElement: HTMLElement, session: IntentBoundStripeSession, eventBroadcaster: EventBroadcaster, defaultValues?: DefaultValues, theme?: PaymentWidgetTheme): Promise<WidgetController>;
|
package/dist/v1/widget.js
CHANGED
|
@@ -41,9 +41,19 @@ import { UnsupportedLocationError } from './error';
|
|
|
41
41
|
import { getLogger } from './logging/logger';
|
|
42
42
|
import { withLogging } from './logging/common';
|
|
43
43
|
import { EventBroadcaster } from './EventBroadcaster';
|
|
44
|
+
import { SDK_VERSION } from '../version';
|
|
45
|
+
// Exposes the running SDK version on the mount point so it can be inspected
|
|
46
|
+
// in browser devtools (e.g. `document.querySelector('[data-lightspeed-payments-sdk-version]')`).
|
|
47
|
+
var SDK_VERSION_ATTRIBUTE = 'data-lightspeed-payments-sdk-version';
|
|
48
|
+
function markMountPointWithSdkVersion(mountPoint) {
|
|
49
|
+
mountPoint.setAttribute(SDK_VERSION_ATTRIBUTE, SDK_VERSION);
|
|
50
|
+
}
|
|
51
|
+
function unmarkMountPointWithSdkVersion(mountPoint) {
|
|
52
|
+
mountPoint.removeAttribute(SDK_VERSION_ATTRIBUTE);
|
|
53
|
+
}
|
|
44
54
|
export function mountPaymentWidget(session, config) {
|
|
45
55
|
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
-
var eventBroadcaster, decodedSession, logger_1, configSummary, widgetController, _a, error_1;
|
|
56
|
+
var eventBroadcaster, decodedSession, logger_1, configSummary, widgetController, _a, unmount_1, error_1;
|
|
47
57
|
return __generator(this, function (_b) {
|
|
48
58
|
switch (_b.label) {
|
|
49
59
|
case 0:
|
|
@@ -82,8 +92,17 @@ export function mountPaymentWidget(session, config) {
|
|
|
82
92
|
return [3 /*break*/, 7];
|
|
83
93
|
case 6: throw new UnsupportedLocationError();
|
|
84
94
|
case 7:
|
|
95
|
+
markMountPointWithSdkVersion(config.mountPoint);
|
|
85
96
|
widgetController.submit = withLogging(logger_1, 'Submit', widgetController.submit);
|
|
86
|
-
|
|
97
|
+
unmount_1 = widgetController.unmount;
|
|
98
|
+
widgetController.unmount = withLogging(logger_1, 'Unmount', function () {
|
|
99
|
+
try {
|
|
100
|
+
unmount_1();
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
unmarkMountPointWithSdkVersion(config.mountPoint);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
87
106
|
return [2 /*return*/, widgetController];
|
|
88
107
|
case 8:
|
|
89
108
|
error_1 = _b.sent();
|
|
@@ -100,7 +119,7 @@ export function mountPaymentWidget(session, config) {
|
|
|
100
119
|
// Internal impl of v1.mountMultiStepWidget (additive; event-based flows unchanged).
|
|
101
120
|
export function mountMultiStepWidget(session, config) {
|
|
102
121
|
return __awaiter(this, void 0, void 0, function () {
|
|
103
|
-
var eventBroadcaster, decodedSession, logger_2, controller, _a, error_2;
|
|
122
|
+
var eventBroadcaster, decodedSession, logger_2, controller, _a, unmount_2, error_2;
|
|
104
123
|
return __generator(this, function (_b) {
|
|
105
124
|
switch (_b.label) {
|
|
106
125
|
case 0:
|
|
@@ -133,9 +152,18 @@ export function mountMultiStepWidget(session, config) {
|
|
|
133
152
|
return [3 /*break*/, 5];
|
|
134
153
|
case 4: throw new UnsupportedLocationError();
|
|
135
154
|
case 5:
|
|
155
|
+
markMountPointWithSdkVersion(config.mountPoint);
|
|
136
156
|
controller.submit = withLogging(logger_2, 'Submit', controller.submit);
|
|
137
157
|
controller.handleNextAction = withLogging(logger_2, 'HandleNextAction', controller.handleNextAction);
|
|
138
|
-
|
|
158
|
+
unmount_2 = controller.unmount;
|
|
159
|
+
controller.unmount = withLogging(logger_2, 'Unmount', function () {
|
|
160
|
+
try {
|
|
161
|
+
unmount_2();
|
|
162
|
+
}
|
|
163
|
+
finally {
|
|
164
|
+
unmarkMountPointWithSdkVersion(config.mountPoint);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
139
167
|
return [2 /*return*/, controller];
|
|
140
168
|
case 6:
|
|
141
169
|
error_2 = _b.sent();
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.9.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightspeed/online-payments-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Process online-payments with Lightspeed Payments",
|
|
5
5
|
"author": "Lightspeed Commerce Inc.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -14,8 +14,11 @@
|
|
|
14
14
|
"dist",
|
|
15
15
|
"styles"
|
|
16
16
|
],
|
|
17
|
-
"sideEffects":
|
|
17
|
+
"sideEffects": [
|
|
18
|
+
"styles/**/*.css"
|
|
19
|
+
],
|
|
18
20
|
"scripts": {
|
|
21
|
+
"pretest": "node scripts/generate-version.js",
|
|
19
22
|
"test": "jest --no-cache --detectOpenHandles",
|
|
20
23
|
"lint": "gts lint",
|
|
21
24
|
"fix": "gts fix",
|
|
@@ -25,8 +28,10 @@
|
|
|
25
28
|
"check-package-content": "npm pack --dry-run",
|
|
26
29
|
"prebuild": "node scripts/generate-version.js",
|
|
27
30
|
"build": "npm run build:esm && npm run build:cjs",
|
|
31
|
+
"postbuild": "node scripts/check-version.js",
|
|
28
32
|
"build:esm": "tsc --module esnext --target es5 --outDir dist --downlevelIteration",
|
|
29
|
-
"build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs --downlevelIteration --declaration false"
|
|
33
|
+
"build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs --downlevelIteration --declaration false",
|
|
34
|
+
"prepack": "node scripts/check-version.js"
|
|
30
35
|
},
|
|
31
36
|
"devDependencies": {
|
|
32
37
|
"@eslint/js": "^9.33.0",
|
|
@@ -84,6 +84,84 @@
|
|
|
84
84
|
color: #30313d;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
.stripe-save-payment-method-container {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
gap: 6px;
|
|
91
|
+
margin: 16px 0 0;
|
|
92
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
|
|
93
|
+
Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
|
94
|
+
font-size: 0.93rem;
|
|
95
|
+
font-weight: 400;
|
|
96
|
+
line-height: 1.5;
|
|
97
|
+
color: #30313d;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
-webkit-tap-highlight-color: transparent;
|
|
100
|
+
-webkit-user-select: none;
|
|
101
|
+
user-select: none;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.stripe-save-payment-method-checkbox {
|
|
105
|
+
appearance: none;
|
|
106
|
+
-webkit-appearance: none;
|
|
107
|
+
-webkit-user-select: none;
|
|
108
|
+
box-sizing: border-box;
|
|
109
|
+
flex: 0 0 20px;
|
|
110
|
+
width: 20px;
|
|
111
|
+
height: 20px;
|
|
112
|
+
margin: 0;
|
|
113
|
+
border: 1px solid #cfd7df;
|
|
114
|
+
border-radius: 5px;
|
|
115
|
+
background-color: #ffffff;
|
|
116
|
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
transition:
|
|
119
|
+
background-color 100ms ease,
|
|
120
|
+
border-color 100ms ease,
|
|
121
|
+
box-shadow 100ms ease;
|
|
122
|
+
user-select: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.stripe-save-payment-method-checkbox:hover {
|
|
126
|
+
border-color: #8792a2;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.stripe-save-payment-method-checkbox:focus-visible {
|
|
130
|
+
border-color: #0570de;
|
|
131
|
+
outline: none;
|
|
132
|
+
box-shadow: 0 0 0 3px rgba(5, 112, 222, 0.2);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.stripe-save-payment-method-checkbox:checked {
|
|
136
|
+
border-color: #0570de;
|
|
137
|
+
background-color: #0570de;
|
|
138
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.25' d='m3.25 8.25 3 3 6.5-6.5'/%3E%3C/svg%3E");
|
|
139
|
+
background-position: center;
|
|
140
|
+
background-repeat: no-repeat;
|
|
141
|
+
background-size: 16px 16px;
|
|
142
|
+
box-shadow: 0 0 0 3px rgba(5, 112, 222, 0.2);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.stripe-save-payment-method-checkbox:checked:focus-visible {
|
|
146
|
+
box-shadow: 0 0 0 3px rgba(5, 112, 222, 0.28);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.stripe-save-payment-method-text {
|
|
150
|
+
min-width: 0;
|
|
151
|
+
-webkit-user-select: none;
|
|
152
|
+
user-select: none;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.stripe-finalization-error {
|
|
156
|
+
margin: 12px 0 0;
|
|
157
|
+
color: #df1b41;
|
|
158
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
|
|
159
|
+
Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
|
160
|
+
font-size: 0.93rem;
|
|
161
|
+
font-weight: 400;
|
|
162
|
+
line-height: 1.5;
|
|
163
|
+
}
|
|
164
|
+
|
|
87
165
|
/* Invoicing theme: only override font-family to match the Inter font
|
|
88
166
|
passed to Stripe Elements via the invoicing theme config. */
|
|
89
167
|
|
|
@@ -93,7 +171,9 @@
|
|
|
93
171
|
|
|
94
172
|
.lsp-theme-invoicing .stripe-custom-terms-text,
|
|
95
173
|
.lsp-theme-invoicing .stripe-expandable-terms-content p,
|
|
96
|
-
.lsp-theme-invoicing .stripe-card-consent-text
|
|
174
|
+
.lsp-theme-invoicing .stripe-card-consent-text,
|
|
175
|
+
.lsp-theme-invoicing .stripe-save-payment-method-container,
|
|
176
|
+
.lsp-theme-invoicing .stripe-finalization-error {
|
|
97
177
|
font-family: 'Inter', system-ui, sans-serif;
|
|
98
178
|
}
|
|
99
179
|
|