@lightspeed/online-payments-sdk 1.0.0 → 1.0.2
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.
|
@@ -12,6 +12,8 @@ var Logger = /** @class */ (function () {
|
|
|
12
12
|
site: site,
|
|
13
13
|
service: 'lsp-online-payments-sdk',
|
|
14
14
|
env: env,
|
|
15
|
+
forwardErrorsToLogs: false,
|
|
16
|
+
forwardConsoleLogs: [],
|
|
15
17
|
};
|
|
16
18
|
var initConfig = browser_logs_1.datadogLogs.getInitConfiguration();
|
|
17
19
|
if (!initConfig) {
|
|
@@ -17,7 +17,9 @@ var EventBuilder = /** @class */ (function () {
|
|
|
17
17
|
var _a, _b;
|
|
18
18
|
var loggingEnrichment = {
|
|
19
19
|
message: stripeError === null || stripeError === void 0 ? void 0 : stripeError.message,
|
|
20
|
-
|
|
20
|
+
stripeErrorType: stripeError === null || stripeError === void 0 ? void 0 : stripeError.type,
|
|
21
|
+
stripeErrorCode: stripeError === null || stripeError === void 0 ? void 0 : stripeError.code,
|
|
22
|
+
stripeDeclineCode: stripeError === null || stripeError === void 0 ? void 0 : stripeError.decline_code,
|
|
21
23
|
paymentIntentId: (_a = stripeError === null || stripeError === void 0 ? void 0 : stripeError.payment_intent) === null || _a === void 0 ? void 0 : _a.id,
|
|
22
24
|
setupIntentId: (_b = stripeError === null || stripeError === void 0 ? void 0 : stripeError.setup_intent) === null || _b === void 0 ? void 0 : _b.id,
|
|
23
25
|
};
|
|
@@ -32,6 +34,13 @@ var EventBuilder = /** @class */ (function () {
|
|
|
32
34
|
};
|
|
33
35
|
case 'processing_error':
|
|
34
36
|
case 'card_declined':
|
|
37
|
+
if ((stripeError === null || stripeError === void 0 ? void 0 : stripeError.decline_code) === 'card_not_supported') {
|
|
38
|
+
return {
|
|
39
|
+
status: 'Refused',
|
|
40
|
+
code: 'PaymentMethodNotSupported',
|
|
41
|
+
loggingEnrichment: loggingEnrichment,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
35
44
|
return {
|
|
36
45
|
status: 'Refused',
|
|
37
46
|
code: 'Generic',
|
|
@@ -13,7 +13,7 @@ export type PendingResultEvent = BaseEvent & {
|
|
|
13
13
|
};
|
|
14
14
|
export type RefusedResultEvent = BaseEvent & {
|
|
15
15
|
status: 'Refused';
|
|
16
|
-
code: 'CardValidation' | 'Generic';
|
|
16
|
+
code: 'CardValidation' | 'Generic' | 'PaymentMethodNotSupported';
|
|
17
17
|
};
|
|
18
18
|
export type ReadyEvent = BaseEvent & {
|
|
19
19
|
status: 'Ready';
|
|
@@ -14,7 +14,9 @@ var EventBuilder = /** @class */ (function () {
|
|
|
14
14
|
var _a, _b;
|
|
15
15
|
var loggingEnrichment = {
|
|
16
16
|
message: stripeError === null || stripeError === void 0 ? void 0 : stripeError.message,
|
|
17
|
-
|
|
17
|
+
stripeErrorType: stripeError === null || stripeError === void 0 ? void 0 : stripeError.type,
|
|
18
|
+
stripeErrorCode: stripeError === null || stripeError === void 0 ? void 0 : stripeError.code,
|
|
19
|
+
stripeDeclineCode: stripeError === null || stripeError === void 0 ? void 0 : stripeError.decline_code,
|
|
18
20
|
paymentIntentId: (_a = stripeError === null || stripeError === void 0 ? void 0 : stripeError.payment_intent) === null || _a === void 0 ? void 0 : _a.id,
|
|
19
21
|
setupIntentId: (_b = stripeError === null || stripeError === void 0 ? void 0 : stripeError.setup_intent) === null || _b === void 0 ? void 0 : _b.id,
|
|
20
22
|
};
|
|
@@ -29,6 +31,13 @@ var EventBuilder = /** @class */ (function () {
|
|
|
29
31
|
};
|
|
30
32
|
case 'processing_error':
|
|
31
33
|
case 'card_declined':
|
|
34
|
+
if ((stripeError === null || stripeError === void 0 ? void 0 : stripeError.decline_code) === 'card_not_supported') {
|
|
35
|
+
return {
|
|
36
|
+
status: 'Refused',
|
|
37
|
+
code: 'PaymentMethodNotSupported',
|
|
38
|
+
loggingEnrichment: loggingEnrichment,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
32
41
|
return {
|
|
33
42
|
status: 'Refused',
|
|
34
43
|
code: 'Generic',
|
package/package.json
CHANGED