@lightspeed/online-payments-sdk 0.2.0 → 0.2.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.
- package/dist/cjs/v1/{AdyenWidget.js → adyen/widget.js} +6 -6
- package/dist/cjs/v1/common.js +36 -0
- package/dist/cjs/v1/error.js +28 -0
- package/dist/cjs/v1/index.js +8 -5
- package/dist/cjs/v1/logging/common.js +4 -0
- package/dist/cjs/v1/logging/datadog/logger.js +30 -0
- package/dist/cjs/v1/logging/logger.js +13 -0
- package/dist/cjs/v1/logging/noop-logger.js +20 -0
- package/dist/cjs/v1/session.error.js +43 -0
- package/dist/cjs/v1/session.js +25 -0
- package/dist/cjs/v1/{StripeWidget.js → stripe/widget.js} +16 -15
- package/dist/cjs/v1/widget.error.js +43 -0
- package/dist/cjs/v1/widget.js +79 -43
- package/dist/v1/{AdyenWidget.d.ts → adyen/widget.d.ts} +2 -2
- package/dist/v1/{AdyenWidget.js → adyen/widget.js} +3 -3
- package/dist/v1/common.d.ts +7 -1
- package/dist/v1/common.js +35 -1
- package/dist/v1/error.d.ts +4 -0
- package/dist/v1/error.js +25 -0
- package/dist/v1/index.d.ts +4 -2
- package/dist/v1/index.js +3 -1
- package/dist/v1/logging/common.d.ts +15 -0
- package/dist/v1/logging/common.js +1 -0
- package/dist/v1/logging/datadog/logger.d.ts +13 -0
- package/dist/v1/logging/datadog/logger.js +26 -0
- package/dist/v1/logging/logger.d.ts +4 -0
- package/dist/v1/logging/logger.js +10 -0
- package/dist/v1/logging/noop-logger.d.ts +8 -0
- package/dist/v1/logging/noop-logger.js +16 -0
- package/dist/v1/session.d.ts +11 -0
- package/dist/v1/session.error.d.ts +15 -0
- package/dist/v1/session.error.js +40 -0
- package/dist/v1/session.js +21 -0
- package/dist/v1/{StripeWidget.d.ts → stripe/widget.d.ts} +3 -3
- package/dist/v1/{StripeWidget.js → stripe/widget.js} +13 -12
- package/dist/v1/widget.d.ts +3 -10
- package/dist/v1/widget.error.d.ts +15 -0
- package/dist/v1/widget.error.js +40 -0
- package/dist/v1/widget.js +78 -39
- package/package.json +6 -4
- package/dist/cjs/v1/errors.js +0 -82
- package/dist/v1/errors.d.ts +0 -42
- package/dist/v1/errors.js +0 -79
- /package/dist/cjs/{AdyenSession.js → v1/adyen/session.js} +0 -0
- /package/dist/cjs/{StripeSession.js → v1/stripe/session.js} +0 -0
- /package/dist/{AdyenSession.d.ts → v1/adyen/session.d.ts} +0 -0
- /package/dist/{AdyenSession.js → v1/adyen/session.js} +0 -0
- /package/dist/{StripeSession.d.ts → v1/stripe/session.d.ts} +0 -0
- /package/dist/{StripeSession.js → v1/stripe/session.js} +0 -0
package/dist/v1/errors.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export declare enum ErrorCode {
|
|
2
|
-
UnsupportedLocation = "UnsupportedLocation",
|
|
3
|
-
InvalidSessionStructure = "InvalidSessionStructure",
|
|
4
|
-
InvalidSessionError = "InvalidSessionError",
|
|
5
|
-
PaymentProcessingError = "PaymentProcessingError"
|
|
6
|
-
}
|
|
7
|
-
export interface CustomError {
|
|
8
|
-
code: ErrorCode;
|
|
9
|
-
}
|
|
10
|
-
declare class BaseError extends Error implements CustomError {
|
|
11
|
-
code: ErrorCode;
|
|
12
|
-
constructor(code: ErrorCode, message: string);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Error thrown when the location is unsupported.
|
|
16
|
-
* @typedef {Error} UnsupportedLocationError
|
|
17
|
-
*/
|
|
18
|
-
export declare class UnsupportedLocationError extends BaseError {
|
|
19
|
-
constructor();
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Error thrown when the session structure is invalid.
|
|
23
|
-
* @typedef {Error} InvalidSessionStructureError
|
|
24
|
-
*/
|
|
25
|
-
export declare class InvalidSessionStructureError extends BaseError {
|
|
26
|
-
constructor();
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Error thrown when the session is invalid.
|
|
30
|
-
* @typedef {Error} InvalidSessionError
|
|
31
|
-
*/
|
|
32
|
-
export declare class InvalidSessionError extends BaseError {
|
|
33
|
-
constructor();
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Error thrown when the session structure is invalid.
|
|
37
|
-
* @typedef {Error} PaymentProcessingError
|
|
38
|
-
*/
|
|
39
|
-
export declare class PaymentProcessingError extends BaseError {
|
|
40
|
-
constructor(message: string);
|
|
41
|
-
}
|
|
42
|
-
export {};
|
package/dist/v1/errors.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
export var ErrorCode;
|
|
17
|
-
(function (ErrorCode) {
|
|
18
|
-
ErrorCode["UnsupportedLocation"] = "UnsupportedLocation";
|
|
19
|
-
ErrorCode["InvalidSessionStructure"] = "InvalidSessionStructure";
|
|
20
|
-
ErrorCode["InvalidSessionError"] = "InvalidSessionError";
|
|
21
|
-
ErrorCode["PaymentProcessingError"] = "PaymentProcessingError";
|
|
22
|
-
})(ErrorCode || (ErrorCode = {}));
|
|
23
|
-
var BaseError = /** @class */ (function (_super) {
|
|
24
|
-
__extends(BaseError, _super);
|
|
25
|
-
function BaseError(code, message) {
|
|
26
|
-
var _this = _super.call(this, message) || this;
|
|
27
|
-
_this.code = code;
|
|
28
|
-
return _this;
|
|
29
|
-
}
|
|
30
|
-
return BaseError;
|
|
31
|
-
}(Error));
|
|
32
|
-
/**
|
|
33
|
-
* Error thrown when the location is unsupported.
|
|
34
|
-
* @typedef {Error} UnsupportedLocationError
|
|
35
|
-
*/
|
|
36
|
-
var UnsupportedLocationError = /** @class */ (function (_super) {
|
|
37
|
-
__extends(UnsupportedLocationError, _super);
|
|
38
|
-
function UnsupportedLocationError() {
|
|
39
|
-
return _super.call(this, ErrorCode.UnsupportedLocation, 'The location you are attempting to process with is not supported') || this;
|
|
40
|
-
}
|
|
41
|
-
return UnsupportedLocationError;
|
|
42
|
-
}(BaseError));
|
|
43
|
-
export { UnsupportedLocationError };
|
|
44
|
-
/**
|
|
45
|
-
* Error thrown when the session structure is invalid.
|
|
46
|
-
* @typedef {Error} InvalidSessionStructureError
|
|
47
|
-
*/
|
|
48
|
-
var InvalidSessionStructureError = /** @class */ (function (_super) {
|
|
49
|
-
__extends(InvalidSessionStructureError, _super);
|
|
50
|
-
function InvalidSessionStructureError() {
|
|
51
|
-
return _super.call(this, ErrorCode.InvalidSessionStructure, 'The contents of the session are invalid') || this;
|
|
52
|
-
}
|
|
53
|
-
return InvalidSessionStructureError;
|
|
54
|
-
}(BaseError));
|
|
55
|
-
export { InvalidSessionStructureError };
|
|
56
|
-
/**
|
|
57
|
-
* Error thrown when the session is invalid.
|
|
58
|
-
* @typedef {Error} InvalidSessionError
|
|
59
|
-
*/
|
|
60
|
-
var InvalidSessionError = /** @class */ (function (_super) {
|
|
61
|
-
__extends(InvalidSessionError, _super);
|
|
62
|
-
function InvalidSessionError() {
|
|
63
|
-
return _super.call(this, ErrorCode.InvalidSessionError, 'The provided session is invalid. Verify the correct session is being passed') || this;
|
|
64
|
-
}
|
|
65
|
-
return InvalidSessionError;
|
|
66
|
-
}(BaseError));
|
|
67
|
-
export { InvalidSessionError };
|
|
68
|
-
/**
|
|
69
|
-
* Error thrown when the session structure is invalid.
|
|
70
|
-
* @typedef {Error} PaymentProcessingError
|
|
71
|
-
*/
|
|
72
|
-
var PaymentProcessingError = /** @class */ (function (_super) {
|
|
73
|
-
__extends(PaymentProcessingError, _super);
|
|
74
|
-
function PaymentProcessingError(message) {
|
|
75
|
-
return _super.call(this, ErrorCode.PaymentProcessingError, "An error occurred while processing the payment. ".concat(message)) || this;
|
|
76
|
-
}
|
|
77
|
-
return PaymentProcessingError;
|
|
78
|
-
}(BaseError));
|
|
79
|
-
export { PaymentProcessingError };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|