@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.
Files changed (100) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/jest.config.js +10 -4
  3. package/lib/base/Helpers.js +17 -28
  4. package/lib/base/Helpers.js.map +1 -1
  5. package/lib/base/RequestBehaviour.js +7 -8
  6. package/lib/base/RequestBehaviour.js.map +1 -1
  7. package/lib/base/Response.js +14 -15
  8. package/lib/base/Response.js.map +1 -1
  9. package/lib/base/ServiceBehaviour.js +67 -144
  10. package/lib/base/ServiceBehaviour.js.map +1 -1
  11. package/lib/browser/index.js +11 -3
  12. package/lib/entities/CardResult.js +10 -11
  13. package/lib/entities/CardResult.js.map +1 -1
  14. package/lib/entities/TransactionResult.js +12 -13
  15. package/lib/entities/TransactionResult.js.map +1 -1
  16. package/lib/exceptions/InvalidCredentialsException.js +2 -22
  17. package/lib/exceptions/InvalidCredentialsException.js.map +1 -1
  18. package/lib/exceptions/InvalidTransactionTypeException.js +2 -22
  19. package/lib/exceptions/InvalidTransactionTypeException.js.map +1 -1
  20. package/lib/exceptions/RunningTransactionException.js +2 -22
  21. package/lib/exceptions/RunningTransactionException.js.map +1 -1
  22. package/lib/index.js +31 -31
  23. package/lib/index.js.map +1 -1
  24. package/lib/libraries/CardinalManager.js +110 -194
  25. package/lib/libraries/CardinalManager.js.map +1 -1
  26. package/lib/libraries/CybersourceManager.js +17 -20
  27. package/lib/libraries/CybersourceManager.js.map +1 -1
  28. package/lib/libraries/PayloadManager.js +22 -44
  29. package/lib/libraries/PayloadManager.js.map +1 -1
  30. package/lib/libraries/PixelPayLoading.js +15 -11
  31. package/lib/libraries/PixelPayLoading.js.map +1 -1
  32. package/lib/libraries/PixelPayModal.js +15 -15
  33. package/lib/libraries/PixelPayModal.js.map +1 -1
  34. package/lib/models/Billing.js +3 -4
  35. package/lib/models/Billing.js.map +1 -1
  36. package/lib/models/Card.js +7 -8
  37. package/lib/models/Card.js.map +1 -1
  38. package/lib/models/Item.js +5 -6
  39. package/lib/models/Item.js.map +1 -1
  40. package/lib/models/Order.js +12 -14
  41. package/lib/models/Order.js.map +1 -1
  42. package/lib/models/Settings.js +17 -18
  43. package/lib/models/Settings.js.map +1 -1
  44. package/lib/requests/AuthTokenization.js +6 -26
  45. package/lib/requests/AuthTokenization.js.map +1 -1
  46. package/lib/requests/AuthTransaction.js +3 -23
  47. package/lib/requests/AuthTransaction.js.map +1 -1
  48. package/lib/requests/CaptureTransaction.js +7 -25
  49. package/lib/requests/CaptureTransaction.js.map +1 -1
  50. package/lib/requests/CardTokenization.js +22 -40
  51. package/lib/requests/CardTokenization.js.map +1 -1
  52. package/lib/requests/LookupContinueTransaction.js +9 -27
  53. package/lib/requests/LookupContinueTransaction.js.map +1 -1
  54. package/lib/requests/LookupTransaction.js +40 -58
  55. package/lib/requests/LookupTransaction.js.map +1 -1
  56. package/lib/requests/PaymentTransaction.js +43 -62
  57. package/lib/requests/PaymentTransaction.js.map +1 -1
  58. package/lib/requests/SaleTransaction.js +13 -31
  59. package/lib/requests/SaleTransaction.js.map +1 -1
  60. package/lib/requests/StatusTransaction.js +6 -24
  61. package/lib/requests/StatusTransaction.js.map +1 -1
  62. package/lib/requests/VoidTransaction.js +8 -26
  63. package/lib/requests/VoidTransaction.js.map +1 -1
  64. package/lib/resources/Environment.js +6 -9
  65. package/lib/resources/Environment.js.map +1 -1
  66. package/lib/resources/Locations.js +6 -6
  67. package/lib/resources/Locations.js.map +1 -1
  68. package/lib/responses/ErrorResponse.js +3 -23
  69. package/lib/responses/ErrorResponse.js.map +1 -1
  70. package/lib/responses/FailureResponse.js +3 -23
  71. package/lib/responses/FailureResponse.js.map +1 -1
  72. package/lib/responses/InputErrorResponse.js +3 -23
  73. package/lib/responses/InputErrorResponse.js.map +1 -1
  74. package/lib/responses/NetworkFailureResponse.js +3 -23
  75. package/lib/responses/NetworkFailureResponse.js.map +1 -1
  76. package/lib/responses/NoAccessResponse.js +3 -23
  77. package/lib/responses/NoAccessResponse.js.map +1 -1
  78. package/lib/responses/NotFoundResponse.js +3 -23
  79. package/lib/responses/NotFoundResponse.js.map +1 -1
  80. package/lib/responses/PayloadResponse.js +3 -23
  81. package/lib/responses/PayloadResponse.js.map +1 -1
  82. package/lib/responses/PaymentDeclinedResponse.js +3 -23
  83. package/lib/responses/PaymentDeclinedResponse.js.map +1 -1
  84. package/lib/responses/PreconditionalResponse.js +3 -23
  85. package/lib/responses/PreconditionalResponse.js.map +1 -1
  86. package/lib/responses/SuccessResponse.js +3 -23
  87. package/lib/responses/SuccessResponse.js.map +1 -1
  88. package/lib/responses/TimeoutResponse.js +3 -23
  89. package/lib/responses/TimeoutResponse.js.map +1 -1
  90. package/lib/services/CardinalAuthentication.js +19 -39
  91. package/lib/services/CardinalAuthentication.js.map +1 -1
  92. package/lib/services/Tokenization.js +58 -157
  93. package/lib/services/Tokenization.js.map +1 -1
  94. package/lib/services/Transaction.js +100 -201
  95. package/lib/services/Transaction.js.map +1 -1
  96. package/lib/version.d.ts +1 -1
  97. package/lib/version.js +1 -1
  98. package/lib/version.js.map +1 -1
  99. package/package.json +3 -3
  100. 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
- var Response_1 = __importDefault(require("../base/Response"));
22
- var NetworkFailureResponse = /** @class */ (function (_super) {
23
- __extends(NetworkFailureResponse, _super);
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":";;;;;;;;;;;;;;;;;;;;AAAA,8DAAwC;AAExC;IAAoD,0CAAQ;IAA5D;;IAEA,CAAC;IAAD,6BAAC;AAAD,CAAC,AAFD,CAAoD,kBAAQ,GAE3D"}
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
- var Response_1 = __importDefault(require("../base/Response"));
22
- var NoAccessResponse = /** @class */ (function (_super) {
23
- __extends(NoAccessResponse, _super);
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":";;;;;;;;;;;;;;;;;;;;AAAA,8DAAwC;AAExC;IAA8C,oCAAQ;IAAtD;;IAEA,CAAC;IAAD,uBAAC;AAAD,CAAC,AAFD,CAA8C,kBAAQ,GAErD"}
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
- var Response_1 = __importDefault(require("../base/Response"));
22
- var NotFoundResponse = /** @class */ (function (_super) {
23
- __extends(NotFoundResponse, _super);
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":";;;;;;;;;;;;;;;;;;;;AAAA,8DAAwC;AAExC;IAA8C,oCAAQ;IAAtD;;IAEA,CAAC;IAAD,uBAAC;AAAD,CAAC,AAFD,CAA8C,kBAAQ,GAErD"}
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
- var Response_1 = __importDefault(require("../base/Response"));
22
- var PayloadResponse = /** @class */ (function (_super) {
23
- __extends(PayloadResponse, _super);
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":";;;;;;;;;;;;;;;;;;;;AAAA,8DAAwC;AAExC;IAA6C,mCAAQ;IAArD;;IAEA,CAAC;IAAD,sBAAC;AAAD,CAAC,AAFD,CAA6C,kBAAQ,GAEpD"}
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
- var Response_1 = __importDefault(require("../base/Response"));
22
- var PaymentDeclinedResponse = /** @class */ (function (_super) {
23
- __extends(PaymentDeclinedResponse, _super);
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":";;;;;;;;;;;;;;;;;;;;AAAA,8DAAwC;AAExC;IAAqD,2CAAQ;IAA7D;;IAEA,CAAC;IAAD,8BAAC;AAAD,CAAC,AAFD,CAAqD,kBAAQ,GAE5D"}
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
- var Response_1 = __importDefault(require("../base/Response"));
22
- var PreconditionalResponse = /** @class */ (function (_super) {
23
- __extends(PreconditionalResponse, _super);
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":";;;;;;;;;;;;;;;;;;;;AAAA,8DAAwC;AAExC;IAAoD,0CAAQ;IAA5D;;IAEA,CAAC;IAAD,6BAAC;AAAD,CAAC,AAFD,CAAoD,kBAAQ,GAE3D"}
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
- var Response_1 = __importDefault(require("../base/Response"));
22
- var SuccessResponse = /** @class */ (function (_super) {
23
- __extends(SuccessResponse, _super);
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":";;;;;;;;;;;;;;;;;;;;AAAA,8DAAwC;AAExC;IAA6C,mCAAQ;IAArD;;IAEA,CAAC;IAAD,sBAAC;AAAD,CAAC,AAFD,CAA6C,kBAAQ,GAEpD"}
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
- var Response_1 = __importDefault(require("../base/Response"));
22
- var TimeoutResponse = /** @class */ (function (_super) {
23
- __extends(TimeoutResponse, _super);
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":";;;;;;;;;;;;;;;;;;;;AAAA,8DAAwC;AAExC;IAA6C,mCAAQ;IAArD;;IAEA,CAAC;IAAD,sBAAC;AAAD,CAAC,AAFD,CAA6C,kBAAQ,GAEpD"}
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
- var ServiceBehaviour_1 = __importDefault(require("../base/ServiceBehaviour"));
22
- var SaleTransaction_1 = __importDefault(require("../requests/SaleTransaction"));
23
- var AuthTransaction_1 = __importDefault(require("../requests/AuthTransaction"));
24
- var InvalidTransactionTypeException_1 = __importDefault(require("../exceptions/InvalidTransactionTypeException"));
25
- var CardinalAuthentication = /** @class */ (function (_super) {
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
- CardinalAuthentication.prototype.free = function () {
14
+ free() {
34
15
  CardinalAuthentication.runningTransaction = null;
35
- };
16
+ }
36
17
  /**
37
18
  * Send an authentication lookup transaction
38
19
  */
39
- CardinalAuthentication.prototype.authenticationLookup = function (transaction) {
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
- CardinalAuthentication.prototype.authenticationContinue = function (transaction) {
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
- CardinalAuthentication.prototype.retryTransaction = function (transaction) {
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
- var url = "api/v2/transaction/".concat(transaction instanceof SaleTransaction_1.default ? 'sale' : 'auth');
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":";;;;;;;;;;;;;;;;;;;;AACA,8EAAwD;AAIxD,gFAA0D;AAC1D,gFAA0D;AAC1D,kHAA4F;AAE5F;IAAoD,0CAAgB;IAApE;;IA6CA,CAAC;IAvCA;;OAEG;IACH,qCAAI,GAAJ;QACC,sBAAsB,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,qDAAoB,GAApB,UAAqB,WAA8B;QAClD,OAAO,IAAI,CAAC,IAAI,CAAC,uCAAuC,EAAE,WAAW,CAAC,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,uDAAsB,GAAtB,UAAuB,WAAsC;QAC5D,OA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