@fat-zebra/sdk 2.0.3-beta.2 → 2.0.3-beta.3

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.
@@ -13,6 +13,7 @@ export default class CardinalManager {
13
13
  setup(jwt: any): void;
14
14
  onPaymentValidated(handler: (data: PaymentValidatedDTO, error: string) => void): void;
15
15
  onPaymentSetupComplete(callback: (data: CardinalSetupCompleteResponseData) => void): void;
16
+ off(event: string): void;
16
17
  processBin(bin: string): Promise<any>;
17
18
  continue(acsUrl: string, pareq: string, transactionId: string): void;
18
19
  }
@@ -63,6 +63,10 @@ export default class CardinalManager {
63
63
  callback(data);
64
64
  });
65
65
  }
66
+ off(event) {
67
+ var _a;
68
+ (_a = window.Cardinal) === null || _a === void 0 ? void 0 : _a.off(event);
69
+ }
66
70
  processBin(bin) {
67
71
  return __awaiter(this, void 0, void 0, function* () {
68
72
  yield window.Cardinal.trigger('bin.process', bin);
package/dist/sca/index.js CHANGED
@@ -102,7 +102,9 @@ class Sca {
102
102
  perform3DS(_a) {
103
103
  return __awaiter(this, arguments, void 0, function* ({ sessionID }) {
104
104
  this.sessionId = sessionID;
105
- // Register handler. Called after OTP is entered on challenge prompt.
105
+ // Clear any orphaned listeners.
106
+ this._cardinal.off('payments.validated');
107
+ // Called after OTP is entered on challenge prompt.
106
108
  this._cardinal.onPaymentValidated((data, error) => __awaiter(this, void 0, void 0, function* () {
107
109
  var _a;
108
110
  if (typeof error == 'string') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fat-zebra/sdk",
3
- "version": "2.0.3-beta.2",
3
+ "version": "2.0.3-beta.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {