@pixelpay/sdk-core 2.3.0-beta.1 → 2.3.1
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/CHANGELOG.md +5 -0
- package/jest.config.js +10 -4
- package/lib/base/Helpers.js +17 -28
- package/lib/base/Helpers.js.map +1 -1
- package/lib/base/RequestBehaviour.js +7 -8
- package/lib/base/RequestBehaviour.js.map +1 -1
- package/lib/base/Response.js +14 -15
- package/lib/base/Response.js.map +1 -1
- package/lib/base/ServiceBehaviour.js +67 -144
- package/lib/base/ServiceBehaviour.js.map +1 -1
- package/lib/browser/index.js +11 -3
- package/lib/entities/CardResult.js +10 -11
- package/lib/entities/CardResult.js.map +1 -1
- package/lib/entities/TransactionResult.js +12 -13
- package/lib/entities/TransactionResult.js.map +1 -1
- package/lib/exceptions/InvalidCredentialsException.js +2 -22
- package/lib/exceptions/InvalidCredentialsException.js.map +1 -1
- package/lib/exceptions/InvalidTransactionTypeException.js +2 -22
- package/lib/exceptions/InvalidTransactionTypeException.js.map +1 -1
- package/lib/exceptions/RunningTransactionException.js +2 -22
- package/lib/exceptions/RunningTransactionException.js.map +1 -1
- package/lib/index.js +31 -31
- package/lib/index.js.map +1 -1
- package/lib/libraries/CardinalManager.js +110 -194
- package/lib/libraries/CardinalManager.js.map +1 -1
- package/lib/libraries/CybersourceManager.js +17 -20
- package/lib/libraries/CybersourceManager.js.map +1 -1
- package/lib/libraries/PayloadManager.js +22 -44
- package/lib/libraries/PayloadManager.js.map +1 -1
- package/lib/libraries/PixelPayLoading.js +15 -11
- package/lib/libraries/PixelPayLoading.js.map +1 -1
- package/lib/libraries/PixelPayModal.js +15 -15
- package/lib/libraries/PixelPayModal.js.map +1 -1
- package/lib/models/Billing.js +3 -4
- package/lib/models/Billing.js.map +1 -1
- package/lib/models/Card.js +7 -8
- package/lib/models/Card.js.map +1 -1
- package/lib/models/Item.js +5 -6
- package/lib/models/Item.js.map +1 -1
- package/lib/models/Order.js +12 -14
- package/lib/models/Order.js.map +1 -1
- package/lib/models/Settings.js +17 -18
- package/lib/models/Settings.js.map +1 -1
- package/lib/requests/AuthTokenization.js +6 -26
- package/lib/requests/AuthTokenization.js.map +1 -1
- package/lib/requests/AuthTransaction.js +3 -23
- package/lib/requests/AuthTransaction.js.map +1 -1
- package/lib/requests/CaptureTransaction.js +7 -25
- package/lib/requests/CaptureTransaction.js.map +1 -1
- package/lib/requests/CardTokenization.js +22 -40
- package/lib/requests/CardTokenization.js.map +1 -1
- package/lib/requests/LookupContinueTransaction.js +9 -27
- package/lib/requests/LookupContinueTransaction.js.map +1 -1
- package/lib/requests/LookupTransaction.js +40 -58
- package/lib/requests/LookupTransaction.js.map +1 -1
- package/lib/requests/PaymentTransaction.js +43 -62
- package/lib/requests/PaymentTransaction.js.map +1 -1
- package/lib/requests/SaleTransaction.js +13 -31
- package/lib/requests/SaleTransaction.js.map +1 -1
- package/lib/requests/StatusTransaction.js +6 -24
- package/lib/requests/StatusTransaction.js.map +1 -1
- package/lib/requests/VoidTransaction.js +8 -26
- package/lib/requests/VoidTransaction.js.map +1 -1
- package/lib/resources/Environment.js +6 -9
- package/lib/resources/Environment.js.map +1 -1
- package/lib/resources/Locations.js +6 -6
- package/lib/resources/Locations.js.map +1 -1
- package/lib/responses/ErrorResponse.js +3 -23
- package/lib/responses/ErrorResponse.js.map +1 -1
- package/lib/responses/FailureResponse.js +3 -23
- package/lib/responses/FailureResponse.js.map +1 -1
- package/lib/responses/InputErrorResponse.js +3 -23
- package/lib/responses/InputErrorResponse.js.map +1 -1
- package/lib/responses/NetworkFailureResponse.js +3 -23
- package/lib/responses/NetworkFailureResponse.js.map +1 -1
- package/lib/responses/NoAccessResponse.js +3 -23
- package/lib/responses/NoAccessResponse.js.map +1 -1
- package/lib/responses/NotFoundResponse.js +3 -23
- package/lib/responses/NotFoundResponse.js.map +1 -1
- package/lib/responses/PayloadResponse.js +3 -23
- package/lib/responses/PayloadResponse.js.map +1 -1
- package/lib/responses/PaymentDeclinedResponse.js +3 -23
- package/lib/responses/PaymentDeclinedResponse.js.map +1 -1
- package/lib/responses/PreconditionalResponse.js +3 -23
- package/lib/responses/PreconditionalResponse.js.map +1 -1
- package/lib/responses/SuccessResponse.js +3 -23
- package/lib/responses/SuccessResponse.js.map +1 -1
- package/lib/responses/TimeoutResponse.js +3 -23
- package/lib/responses/TimeoutResponse.js.map +1 -1
- package/lib/services/CardinalAuthentication.js +19 -39
- package/lib/services/CardinalAuthentication.js.map +1 -1
- package/lib/services/Tokenization.js +58 -157
- package/lib/services/Tokenization.js.map +1 -1
- package/lib/services/Transaction.js +100 -201
- package/lib/services/Transaction.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +3 -3
- package/tsconfig.json +2 -3
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function NetworkFailureResponse() {
|
|
25
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
-
}
|
|
27
|
-
return NetworkFailureResponse;
|
|
28
|
-
}(Response_1.default));
|
|
6
|
+
const Response_1 = __importDefault(require("../base/Response"));
|
|
7
|
+
class NetworkFailureResponse extends Response_1.default {
|
|
8
|
+
}
|
|
29
9
|
exports.default = NetworkFailureResponse;
|
|
30
10
|
//# sourceMappingURL=NetworkFailureResponse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkFailureResponse.js","sourceRoot":"","sources":["../../src/responses/NetworkFailureResponse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NetworkFailureResponse.js","sourceRoot":"","sources":["../../src/responses/NetworkFailureResponse.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AAExC,MAAqB,sBAAuB,SAAQ,kBAAQ;CAE3D;AAFD,yCAEC"}
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function NoAccessResponse() {
|
|
25
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
-
}
|
|
27
|
-
return NoAccessResponse;
|
|
28
|
-
}(Response_1.default));
|
|
6
|
+
const Response_1 = __importDefault(require("../base/Response"));
|
|
7
|
+
class NoAccessResponse extends Response_1.default {
|
|
8
|
+
}
|
|
29
9
|
exports.default = NoAccessResponse;
|
|
30
10
|
//# sourceMappingURL=NoAccessResponse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoAccessResponse.js","sourceRoot":"","sources":["../../src/responses/NoAccessResponse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NoAccessResponse.js","sourceRoot":"","sources":["../../src/responses/NoAccessResponse.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AAExC,MAAqB,gBAAiB,SAAQ,kBAAQ;CAErD;AAFD,mCAEC"}
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function NotFoundResponse() {
|
|
25
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
-
}
|
|
27
|
-
return NotFoundResponse;
|
|
28
|
-
}(Response_1.default));
|
|
6
|
+
const Response_1 = __importDefault(require("../base/Response"));
|
|
7
|
+
class NotFoundResponse extends Response_1.default {
|
|
8
|
+
}
|
|
29
9
|
exports.default = NotFoundResponse;
|
|
30
10
|
//# sourceMappingURL=NotFoundResponse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotFoundResponse.js","sourceRoot":"","sources":["../../src/responses/NotFoundResponse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NotFoundResponse.js","sourceRoot":"","sources":["../../src/responses/NotFoundResponse.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AAExC,MAAqB,gBAAiB,SAAQ,kBAAQ;CAErD;AAFD,mCAEC"}
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function PayloadResponse() {
|
|
25
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
-
}
|
|
27
|
-
return PayloadResponse;
|
|
28
|
-
}(Response_1.default));
|
|
6
|
+
const Response_1 = __importDefault(require("../base/Response"));
|
|
7
|
+
class PayloadResponse extends Response_1.default {
|
|
8
|
+
}
|
|
29
9
|
exports.default = PayloadResponse;
|
|
30
10
|
//# sourceMappingURL=PayloadResponse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayloadResponse.js","sourceRoot":"","sources":["../../src/responses/PayloadResponse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PayloadResponse.js","sourceRoot":"","sources":["../../src/responses/PayloadResponse.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AAExC,MAAqB,eAAgB,SAAQ,kBAAQ;CAEpD;AAFD,kCAEC"}
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function PaymentDeclinedResponse() {
|
|
25
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
-
}
|
|
27
|
-
return PaymentDeclinedResponse;
|
|
28
|
-
}(Response_1.default));
|
|
6
|
+
const Response_1 = __importDefault(require("../base/Response"));
|
|
7
|
+
class PaymentDeclinedResponse extends Response_1.default {
|
|
8
|
+
}
|
|
29
9
|
exports.default = PaymentDeclinedResponse;
|
|
30
10
|
//# sourceMappingURL=PaymentDeclinedResponse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentDeclinedResponse.js","sourceRoot":"","sources":["../../src/responses/PaymentDeclinedResponse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaymentDeclinedResponse.js","sourceRoot":"","sources":["../../src/responses/PaymentDeclinedResponse.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AAExC,MAAqB,uBAAwB,SAAQ,kBAAQ;CAE5D;AAFD,0CAEC"}
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function PreconditionalResponse() {
|
|
25
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
-
}
|
|
27
|
-
return PreconditionalResponse;
|
|
28
|
-
}(Response_1.default));
|
|
6
|
+
const Response_1 = __importDefault(require("../base/Response"));
|
|
7
|
+
class PreconditionalResponse extends Response_1.default {
|
|
8
|
+
}
|
|
29
9
|
exports.default = PreconditionalResponse;
|
|
30
10
|
//# sourceMappingURL=PreconditionalResponse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreconditionalResponse.js","sourceRoot":"","sources":["../../src/responses/PreconditionalResponse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreconditionalResponse.js","sourceRoot":"","sources":["../../src/responses/PreconditionalResponse.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AAExC,MAAqB,sBAAuB,SAAQ,kBAAQ;CAE3D;AAFD,yCAEC"}
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function SuccessResponse() {
|
|
25
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
-
}
|
|
27
|
-
return SuccessResponse;
|
|
28
|
-
}(Response_1.default));
|
|
6
|
+
const Response_1 = __importDefault(require("../base/Response"));
|
|
7
|
+
class SuccessResponse extends Response_1.default {
|
|
8
|
+
}
|
|
29
9
|
exports.default = SuccessResponse;
|
|
30
10
|
//# sourceMappingURL=SuccessResponse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuccessResponse.js","sourceRoot":"","sources":["../../src/responses/SuccessResponse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SuccessResponse.js","sourceRoot":"","sources":["../../src/responses/SuccessResponse.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AAExC,MAAqB,eAAgB,SAAQ,kBAAQ;CAEpD;AAFD,kCAEC"}
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function TimeoutResponse() {
|
|
25
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
-
}
|
|
27
|
-
return TimeoutResponse;
|
|
28
|
-
}(Response_1.default));
|
|
6
|
+
const Response_1 = __importDefault(require("../base/Response"));
|
|
7
|
+
class TimeoutResponse extends Response_1.default {
|
|
8
|
+
}
|
|
29
9
|
exports.default = TimeoutResponse;
|
|
30
10
|
//# sourceMappingURL=TimeoutResponse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeoutResponse.js","sourceRoot":"","sources":["../../src/responses/TimeoutResponse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeoutResponse.js","sourceRoot":"","sources":["../../src/responses/TimeoutResponse.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AAExC,MAAqB,eAAgB,SAAQ,kBAAQ;CAEpD;AAFD,kCAEC"}
|
|
@@ -1,54 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
__extends(CardinalAuthentication, _super);
|
|
27
|
-
function CardinalAuthentication() {
|
|
28
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
29
|
-
}
|
|
6
|
+
const ServiceBehaviour_1 = __importDefault(require("../base/ServiceBehaviour"));
|
|
7
|
+
const SaleTransaction_1 = __importDefault(require("../requests/SaleTransaction"));
|
|
8
|
+
const AuthTransaction_1 = __importDefault(require("../requests/AuthTransaction"));
|
|
9
|
+
const InvalidTransactionTypeException_1 = __importDefault(require("../exceptions/InvalidTransactionTypeException"));
|
|
10
|
+
class CardinalAuthentication extends ServiceBehaviour_1.default {
|
|
30
11
|
/**
|
|
31
12
|
* Allow future transactions to run safely by cleaning the running transaction
|
|
32
13
|
*/
|
|
33
|
-
|
|
14
|
+
free() {
|
|
34
15
|
CardinalAuthentication.runningTransaction = null;
|
|
35
|
-
}
|
|
16
|
+
}
|
|
36
17
|
/**
|
|
37
18
|
* Send an authentication lookup transaction
|
|
38
19
|
*/
|
|
39
|
-
|
|
20
|
+
authenticationLookup(transaction) {
|
|
40
21
|
return this.post('api/v2/cardinal/authentication/lookup', transaction);
|
|
41
|
-
}
|
|
22
|
+
}
|
|
42
23
|
/**
|
|
43
24
|
* Send and validate authentication continue transaction
|
|
44
25
|
*/
|
|
45
|
-
|
|
26
|
+
authenticationContinue(transaction) {
|
|
46
27
|
return this.post('api/v2/cardinal/authentication/continue', transaction);
|
|
47
|
-
}
|
|
28
|
+
}
|
|
48
29
|
/**
|
|
49
30
|
* Send payment transaction by type (Sale/Auth)
|
|
50
31
|
*/
|
|
51
|
-
|
|
32
|
+
retryTransaction(transaction) {
|
|
52
33
|
if (CardinalAuthentication.runningTransaction) {
|
|
53
34
|
return CardinalAuthentication.runningTransaction;
|
|
54
35
|
}
|
|
@@ -56,15 +37,14 @@ var CardinalAuthentication = /** @class */ (function (_super) {
|
|
|
56
37
|
this.free();
|
|
57
38
|
throw new InvalidTransactionTypeException_1.default('The request payment type is invalid.');
|
|
58
39
|
}
|
|
59
|
-
|
|
40
|
+
const url = `api/v2/transaction/${transaction instanceof SaleTransaction_1.default ? 'sale' : 'auth'}`;
|
|
60
41
|
CardinalAuthentication.runningTransaction = this.post(url, transaction).finally(this.free);
|
|
61
42
|
return CardinalAuthentication.runningTransaction;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
* Stored running transaction to prevent duplicates
|
|
65
|
-
*/
|
|
66
|
-
CardinalAuthentication.runningTransaction = null;
|
|
67
|
-
return CardinalAuthentication;
|
|
68
|
-
}(ServiceBehaviour_1.default));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
69
45
|
exports.default = CardinalAuthentication;
|
|
46
|
+
/**
|
|
47
|
+
* Stored running transaction to prevent duplicates
|
|
48
|
+
*/
|
|
49
|
+
CardinalAuthentication.runningTransaction = null;
|
|
70
50
|
//# sourceMappingURL=CardinalAuthentication.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardinalAuthentication.js","sourceRoot":"","sources":["../../src/services/CardinalAuthentication.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CardinalAuthentication.js","sourceRoot":"","sources":["../../src/services/CardinalAuthentication.ts"],"names":[],"mappings":";;;;;AACA,gFAAwD;AAIxD,kFAA0D;AAC1D,kFAA0D;AAC1D,oHAA4F;AAE5F,MAAqB,sBAAuB,SAAQ,0BAAgB;IAMnE;;OAEG;IACH,IAAI;QACH,sBAAsB,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,oBAAoB,CAAC,WAA8B;QAClD,OAAO,IAAI,CAAC,IAAI,CAAC,uCAAuC,EAAE,WAAW,CAAC,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,sBAAsB,CAAC,WAAsC;QAC5D,OAAO,IAAI,CAAC,IAAI,CAAC,yCAAyC,EAAE,WAAW,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACH,gBAAgB,CAAC,WAA+B;QAC/C,IAAI,sBAAsB,CAAC,kBAAkB,EAAE;YAC9C,OAAO,sBAAsB,CAAC,kBAAkB,CAAC;SACjD;QAED,IAAI,CAAC,CAAC,WAAW,YAAY,yBAAe,CAAC,IAAI,CAAC,CAAC,WAAW,YAAY,yBAAe,CAAC,EAAE;YAC3F,IAAI,CAAC,IAAI,EAAE,CAAC;YACZ,MAAM,IAAI,yCAA+B,CAAC,sCAAsC,CAAC,CAAC;SAClF;QAED,MAAM,GAAG,GAAG,sBAAsB,WAAW,YAAY,yBAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAE7F,sBAAsB,CAAC,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3F,OAAO,sBAAsB,CAAC,kBAAkB,CAAC;IAClD,CAAC;;AA5CF,yCA6CC;AA5CA;;GAEG;AACI,yCAAkB,GAAsB,IAAI,CAAC"}
|