@lightspeed/online-payments-sdk 1.0.3 → 1.0.5
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/ResultBuilder.js +16 -0
- package/dist/cjs/v1/stripe/widget.js +14 -5
- package/dist/v1/logging/noop-logger.d.ts +1 -1
- package/dist/v1/session.js +1 -1
- package/dist/v1/stripe/ResultBuilder.js +16 -0
- package/dist/v1/stripe/session.d.ts +2 -0
- package/dist/v1/stripe/widget.js +14 -5
- package/package.json +12 -10
package/dist/cjs/v1/session.js
CHANGED
|
@@ -27,6 +27,13 @@ var EventBuilder = /** @class */ (function () {
|
|
|
27
27
|
case 'expired_card':
|
|
28
28
|
case 'incorrect_cvc':
|
|
29
29
|
case 'incorrect_number':
|
|
30
|
+
case 'invalid_cvc':
|
|
31
|
+
case 'invalid_zip':
|
|
32
|
+
case 'incomplete_number':
|
|
33
|
+
case 'incomplete_cvc':
|
|
34
|
+
case 'invalid_postal_code':
|
|
35
|
+
case 'invalid_number':
|
|
36
|
+
case 'incomplete_expiry':
|
|
30
37
|
return {
|
|
31
38
|
status: 'Refused',
|
|
32
39
|
code: 'CardValidation',
|
|
@@ -46,6 +53,15 @@ var EventBuilder = /** @class */ (function () {
|
|
|
46
53
|
code: 'Generic',
|
|
47
54
|
loggingEnrichment: loggingEnrichment,
|
|
48
55
|
};
|
|
56
|
+
case 'insufficient_funds':
|
|
57
|
+
case 'invalid_expiry_month_past':
|
|
58
|
+
case 'generic_decline':
|
|
59
|
+
case 'lost_card':
|
|
60
|
+
return {
|
|
61
|
+
status: 'Refused',
|
|
62
|
+
code: 'Generic',
|
|
63
|
+
loggingEnrichment: loggingEnrichment,
|
|
64
|
+
};
|
|
49
65
|
default:
|
|
50
66
|
return {
|
|
51
67
|
status: 'Error',
|
|
@@ -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/v1/session.js
CHANGED
|
@@ -24,6 +24,13 @@ var EventBuilder = /** @class */ (function () {
|
|
|
24
24
|
case 'expired_card':
|
|
25
25
|
case 'incorrect_cvc':
|
|
26
26
|
case 'incorrect_number':
|
|
27
|
+
case 'invalid_cvc':
|
|
28
|
+
case 'invalid_zip':
|
|
29
|
+
case 'incomplete_number':
|
|
30
|
+
case 'incomplete_cvc':
|
|
31
|
+
case 'invalid_postal_code':
|
|
32
|
+
case 'invalid_number':
|
|
33
|
+
case 'incomplete_expiry':
|
|
27
34
|
return {
|
|
28
35
|
status: 'Refused',
|
|
29
36
|
code: 'CardValidation',
|
|
@@ -43,6 +50,15 @@ var EventBuilder = /** @class */ (function () {
|
|
|
43
50
|
code: 'Generic',
|
|
44
51
|
loggingEnrichment: loggingEnrichment,
|
|
45
52
|
};
|
|
53
|
+
case 'insufficient_funds':
|
|
54
|
+
case 'invalid_expiry_month_past':
|
|
55
|
+
case 'generic_decline':
|
|
56
|
+
case 'lost_card':
|
|
57
|
+
return {
|
|
58
|
+
status: 'Refused',
|
|
59
|
+
code: 'Generic',
|
|
60
|
+
loggingEnrichment: loggingEnrichment,
|
|
61
|
+
};
|
|
46
62
|
default:
|
|
47
63
|
return {
|
|
48
64
|
status: 'Error',
|
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightspeed/online-payments-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
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
|
}
|