@lightspeed/online-payments-sdk 1.0.2 → 1.0.4
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/dist/cjs/v1/session.js +1 -1
- package/dist/cjs/v1/stripe/widget.js +14 -5
- package/dist/cjs/v1/widget.js +2 -1
- package/dist/v1/logging/noop-logger.d.ts +1 -1
- package/dist/v1/session.js +1 -1
- package/dist/v1/stripe/session.d.ts +2 -0
- package/dist/v1/stripe/widget.js +14 -5
- package/dist/v1/widget.js +2 -1
- package/package.json +12 -10
package/dist/cjs/v1/session.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
14
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
15
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -43,7 +54,7 @@ var ResultBuilder_1 = require("./ResultBuilder");
|
|
|
43
54
|
var error_1 = require("../error");
|
|
44
55
|
function init(context) {
|
|
45
56
|
return __awaiter(this, void 0, void 0, function () {
|
|
46
|
-
var publishableKey, clientSecret, customerSessionClientSecret, loadedStripe, stripe, elements;
|
|
57
|
+
var publishableKey, clientSecret, customerSessionClientSecret, loadedStripe, stripe, elementsOptions, elements;
|
|
47
58
|
return __generator(this, function (_a) {
|
|
48
59
|
switch (_a.label) {
|
|
49
60
|
case 0:
|
|
@@ -55,10 +66,8 @@ function init(context) {
|
|
|
55
66
|
throw new Error('Failed to initialize Stripe');
|
|
56
67
|
}
|
|
57
68
|
stripe = loadedStripe;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
customerSessionClientSecret: customerSessionClientSecret,
|
|
61
|
-
});
|
|
69
|
+
elementsOptions = __assign({ clientSecret: clientSecret, customerSessionClientSecret: customerSessionClientSecret }, (context.locale && { locale: context.locale }));
|
|
70
|
+
elements = stripe.elements(elementsOptions);
|
|
62
71
|
return [2 /*return*/, { stripe: stripe, elements: elements }];
|
|
63
72
|
}
|
|
64
73
|
});
|
package/dist/cjs/v1/widget.js
CHANGED
|
@@ -58,7 +58,8 @@ function mountPaymentWidget(session, config) {
|
|
|
58
58
|
logger_2 = (0, logger_1.getLogger)(decodedSession.logging);
|
|
59
59
|
logger_2.setSessionMetadata(decodedSession.metadata);
|
|
60
60
|
eventBroadcaster.registerMiddleware(function (event) {
|
|
61
|
-
|
|
61
|
+
// don't log the event directly because the event.status overwrites the datadog status code
|
|
62
|
+
logger_2.log('info', event.status, { event: event });
|
|
62
63
|
return event;
|
|
63
64
|
});
|
|
64
65
|
logger_2.log('info', 'Mount');
|
package/dist/v1/session.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StripeElementLocale } from "@stripe/stripe-js";
|
|
1
2
|
export type StripeSession = {
|
|
2
3
|
psp: 'STRIPE';
|
|
3
4
|
context: StripeContext;
|
|
@@ -7,4 +8,5 @@ export type StripeContext = {
|
|
|
7
8
|
publishableKey: string;
|
|
8
9
|
customerSessionClientSecret?: string;
|
|
9
10
|
intent: 'save-card' | 'payment';
|
|
11
|
+
locale?: StripeElementLocale;
|
|
10
12
|
};
|
package/dist/v1/stripe/widget.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
13
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
14
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -39,7 +50,7 @@ import { EventBuilder } from './ResultBuilder';
|
|
|
39
50
|
import { InvalidSessionPayloadError, ProcessingError } from '../error';
|
|
40
51
|
function init(context) {
|
|
41
52
|
return __awaiter(this, void 0, void 0, function () {
|
|
42
|
-
var publishableKey, clientSecret, customerSessionClientSecret, loadedStripe, stripe, elements;
|
|
53
|
+
var publishableKey, clientSecret, customerSessionClientSecret, loadedStripe, stripe, elementsOptions, elements;
|
|
43
54
|
return __generator(this, function (_a) {
|
|
44
55
|
switch (_a.label) {
|
|
45
56
|
case 0:
|
|
@@ -51,10 +62,8 @@ function init(context) {
|
|
|
51
62
|
throw new Error('Failed to initialize Stripe');
|
|
52
63
|
}
|
|
53
64
|
stripe = loadedStripe;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
customerSessionClientSecret: customerSessionClientSecret,
|
|
57
|
-
});
|
|
65
|
+
elementsOptions = __assign({ clientSecret: clientSecret, customerSessionClientSecret: customerSessionClientSecret }, (context.locale && { locale: context.locale }));
|
|
66
|
+
elements = stripe.elements(elementsOptions);
|
|
58
67
|
return [2 /*return*/, { stripe: stripe, elements: elements }];
|
|
59
68
|
}
|
|
60
69
|
});
|
package/dist/v1/widget.js
CHANGED
|
@@ -55,7 +55,8 @@ export function mountPaymentWidget(session, config) {
|
|
|
55
55
|
logger_1 = getLogger(decodedSession.logging);
|
|
56
56
|
logger_1.setSessionMetadata(decodedSession.metadata);
|
|
57
57
|
eventBroadcaster.registerMiddleware(function (event) {
|
|
58
|
-
|
|
58
|
+
// don't log the event directly because the event.status overwrites the datadog status code
|
|
59
|
+
logger_1.log('info', event.status, { event: event });
|
|
59
60
|
return event;
|
|
60
61
|
});
|
|
61
62
|
logger_1.log('info', 'Mount');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightspeed/online-payments-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Process online-payments with Lightspeed Payments",
|
|
5
5
|
"author": "Lightspeed Commerce Inc.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -27,19 +27,21 @@
|
|
|
27
27
|
"build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs --downlevelIteration --declaration false"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
+
"@eslint/js": "^9.33.0",
|
|
30
31
|
"@types/jest": "^30.0.0",
|
|
31
32
|
"gts": "^6.0.2",
|
|
32
|
-
"jest": "^30.0.
|
|
33
|
-
"jest-environment-jsdom": "^30.0.
|
|
33
|
+
"jest": "^30.0.5",
|
|
34
|
+
"jest-environment-jsdom": "^30.0.5",
|
|
34
35
|
"jest-junit": "^16.0.0",
|
|
35
|
-
"rollup": "^4.
|
|
36
|
-
"ts-jest": "^29.
|
|
37
|
-
"tslib": "^2.
|
|
38
|
-
"typescript": "^5.
|
|
36
|
+
"rollup": "^4.46.2",
|
|
37
|
+
"ts-jest": "^29.4.1",
|
|
38
|
+
"tslib": "^2.8.1",
|
|
39
|
+
"typescript": "^5.9.2",
|
|
40
|
+
"typescript-eslint": "^8.39.1"
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
41
|
-
"@adyen/adyen-web": "^6.
|
|
42
|
-
"@datadog/browser-logs": "^6.
|
|
43
|
-
"@stripe/stripe-js": "^7.
|
|
43
|
+
"@adyen/adyen-web": "^6.19.0",
|
|
44
|
+
"@datadog/browser-logs": "^6.17.0",
|
|
45
|
+
"@stripe/stripe-js": "^7.8.0"
|
|
44
46
|
}
|
|
45
47
|
}
|