@paydock/client-sdk 1.100.0 → 1.102.0-beta

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.
@@ -684,7 +684,7 @@
684
684
  // the empty string is set in case if version not provided.
685
685
  //
686
686
  // e.g: grunt build --sdk-version=v1.0.0
687
- SDK._version = 'v1.100.0';
687
+ SDK._version = 'v1.102.0-beta';
688
688
 
689
689
  var ENV = {
690
690
  SANDBOX: 'sandbox',
@@ -6575,7 +6575,8 @@
6575
6575
  PAYMENT_SUCCESS: 'payment_success',
6576
6576
  PAYMENT_IN_REVIEW: 'payment_in_review',
6577
6577
  PAYMENT_ERROR: 'payment_error',
6578
- CALLBACK: 'callback'
6578
+ CALLBACK: 'callback',
6579
+ AUTH_TOKENS_CHANGED: 'auth_tokens_changed'
6579
6580
  };
6580
6581
  var WalletService = /*#__PURE__*/function () {
6581
6582
  function WalletService(publicKey, meta) {
@@ -8364,14 +8365,16 @@
8364
8365
  return [].concat(_toConsumableArray(str), ["".concat(key).concat(separator).concat(value)]);
8365
8366
  }, []).join(",") : "";
8366
8367
  }
8368
+
8369
+ // src/checkout.ts
8367
8370
  var Checkout = /*#__PURE__*/function () {
8368
8371
  function Checkout(_ref3) {
8369
8372
  var _this = this,
8370
8373
  _this$callback;
8371
- var url = _ref3.url,
8372
- accessToken = _ref3.accessToken,
8373
- refreshToken = _ref3.refreshToken,
8374
+ var auth = _ref3.auth,
8375
+ url = _ref3.url,
8374
8376
  clientId = _ref3.clientId,
8377
+ mode = _ref3.mode,
8375
8378
  orderId = _ref3.orderId,
8376
8379
  onCheckoutClosed = _ref3.onCheckoutClosed,
8377
8380
  onError = _ref3.onError,
@@ -8386,6 +8389,7 @@
8386
8389
  _defineProperty(this, "DEFAULT_FEATURES", {
8387
8390
  resizable: "no"
8388
8391
  });
8392
+ _defineProperty(this, "auth", void 0);
8389
8393
  _defineProperty(this, "callback", void 0);
8390
8394
  _defineProperty(this, "error", void 0);
8391
8395
  _defineProperty(this, "frame", void 0);
@@ -8397,7 +8401,8 @@
8397
8401
  _defineProperty(this, "refreshToken", void 0);
8398
8402
  _defineProperty(this, "clientId", void 0);
8399
8403
  _defineProperty(this, "onCheckoutClosed", void 0);
8400
- _defineProperty(this, "onTokensChanged", void 0);
8404
+ _defineProperty(this, "rootUrl", void 0);
8405
+ _defineProperty(this, "targetOrigin", void 0);
8401
8406
  _defineProperty(this, "title", void 0);
8402
8407
  _defineProperty(this, "windowFeatures", void 0);
8403
8408
  _defineProperty(this, "windowObserver", void 0);
@@ -8421,7 +8426,13 @@
8421
8426
  window.addEventListener("message", _this.onMessage, false);
8422
8427
  }
8423
8428
  });
8424
- var merchantURL = encodeURIComponent(window.location.href.replace(/\/$/, ""));
8429
+ _defineProperty(this, "postMessage", function () {
8430
+ if (!!_this.frame && !!_this.rootUrl) {
8431
+ _this.frame.postMessage({
8432
+ auth: _objectSpread2({}, _this.auth)
8433
+ }, _this.rootUrl);
8434
+ }
8435
+ });
8425
8436
  this.callback = (_this$callback = {}, _defineProperty(_this$callback, "ERROR" /* ERROR */, function ERROR(_ref4) {
8426
8437
  var error = _ref4.error,
8427
8438
  orderId2 = _ref4.orderId;
@@ -8442,13 +8453,14 @@
8442
8453
  orderId: orderId2
8443
8454
  });
8444
8455
  }), _defineProperty(_this$callback, "TOKENS_CHANGED" /* TOKENS_CHANGED */, function TOKENS_CHANGED(_ref7) {
8445
- var accessToken2 = _ref7.accessToken,
8446
- refreshToken2 = _ref7.refreshToken;
8456
+ var accessToken = _ref7.accessToken,
8457
+ refreshToken = _ref7.refreshToken;
8447
8458
  onTokensChanged === null || onTokensChanged === void 0 || onTokensChanged({
8448
- accessToken: accessToken2,
8449
- refreshToken: refreshToken2
8459
+ accessToken: accessToken,
8460
+ refreshToken: refreshToken
8450
8461
  });
8451
8462
  }), _this$callback);
8463
+ this.auth = auth;
8452
8464
  this.isCheckoutOpen = false;
8453
8465
  this.error = void 0;
8454
8466
  this.frame = void 0;
@@ -8456,6 +8468,9 @@
8456
8468
  var data = e.data,
8457
8469
  origin = e.origin;
8458
8470
  if (origin === url) {
8471
+ if ((data === null || data === void 0 ? void 0 : data.isDomReady) === true) {
8472
+ _this.postMessage();
8473
+ }
8459
8474
  if (data !== null && data !== void 0 && data.isPaymentSuccessful) {
8460
8475
  _this.callback["PAYMENT_SUCCESS" /* PAYMENT_SUCCESS */]({
8461
8476
  orderId: data.orderId
@@ -8481,13 +8496,13 @@
8481
8496
  }
8482
8497
  }
8483
8498
  };
8484
- this.url = "".concat(url, "?orderId=").concat(orderId, "&merchant=").concat(merchantURL);
8499
+ var checkoutMode = mode || "default" /* DEFAULT */;
8500
+ this.rootUrl = url;
8501
+ this.targetOrigin = window.location.href.replace(/\/$/, "");
8502
+ this.url = "".concat(url, "?orderId=").concat(orderId, "&merchantUrl=").concat(encodeURIComponent(this.targetOrigin), "&mode=").concat(checkoutMode);
8485
8503
  this.orderId = orderId;
8486
- this.accessToken = accessToken;
8487
- this.refreshToken = refreshToken;
8488
8504
  this.clientId = clientId;
8489
8505
  this.onCheckoutClosed = onCheckoutClosed;
8490
- this.onTokensChanged = onTokensChanged;
8491
8506
  this.title = title;
8492
8507
  this.windowFeatures = windowFeatures;
8493
8508
  this.windowObserver = void 0;
@@ -8587,36 +8602,37 @@
8587
8602
  return _regeneratorRuntime().wrap(function _callee$(_context) {
8588
8603
  while (1) switch (_context.prev = _context.next) {
8589
8604
  case 0:
8590
- loadingOverlay = document.getElementById("loading-overlay");
8591
- button = document.getElementById("flypay-v2-button");
8605
+ loadingOverlay = document.getElementById('loading-overlay');
8606
+ button = document.getElementById('flypay-v2-button');
8592
8607
  if (button) button.disabled = true;
8593
8608
  _context.prev = 3;
8594
8609
  if (this.orderId) {
8595
8610
  _context.next = 9;
8596
8611
  break;
8597
8612
  }
8598
- if (loadingOverlay) loadingOverlay.style.display = "flex";
8613
+ if (loadingOverlay) loadingOverlay.style.display = 'flex';
8599
8614
  _context.next = 8;
8600
8615
  return this.getOrderId();
8601
8616
  case 8:
8602
8617
  this.orderId = _context.sent;
8603
8618
  case 9:
8604
- if (loadingOverlay) loadingOverlay.style.display = "none";
8619
+ if (loadingOverlay) loadingOverlay.style.display = 'none';
8605
8620
  if (this.orderId) {
8606
8621
  this.flypayV2Checkout(this.orderId);
8607
8622
  } else {
8608
8623
  this.eventEmitter.emit(WALLET_EVENT.UNAVAILABLE);
8609
8624
  }
8610
- _context.next = 17;
8625
+ _context.next = 18;
8611
8626
  break;
8612
8627
  case 13:
8613
8628
  _context.prev = 13;
8614
8629
  _context.t0 = _context["catch"](3);
8615
- if (loadingOverlay) loadingOverlay.style.display = "none";
8630
+ if (loadingOverlay) loadingOverlay.style.display = 'none';
8631
+ if (button) button.disabled = false;
8616
8632
  this.eventEmitter.emit(WALLET_EVENT.UNAVAILABLE, {
8617
8633
  err: _context.t0
8618
8634
  });
8619
- case 17:
8635
+ case 18:
8620
8636
  case "end":
8621
8637
  return _context.stop();
8622
8638
  }
@@ -8662,7 +8678,7 @@
8662
8678
  }, {
8663
8679
  key: "createButtonStyle",
8664
8680
  value: function createButtonStyle() {
8665
- return "\n #widget {\n position: relative;\n }\n\n #loading-overlay {\n position: absolute;\n width: 268px;\n height: 74px;\n background: rgba(255, 255, 255, 0.7);\n display: none;\n justify-content: center;\n align-items: center;\n }\n\n #loading-overlay::after {\n content: \"\";\n display: inline-block;\n width: 40px;\n height: 40px;\n border: 4px solid #ccc;\n border-top-color: #333;\n border-radius: 50%;\n\n /* Vendor prefixes for animation property */\n -webkit-animation: spin 1s infinite linear;\n -moz-animation: spin 1s infinite linear;\n -o-animation: spin 1s infinite linear;\n animation: spin 1s infinite linear;\n }\n\n @-webkit-keyframes spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n\n @-moz-keyframes spin {\n 0% {\n -moz-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -moz-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n\n @-o-keyframes spin {\n 0% {\n -o-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -o-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n\n .flypay-v2-checkout-btn {\n border: none; /* Remove borders */\n background: transparent; /* Make the button background transparent */\n cursor: pointer; /* Make it look clickable */\n outline: none; /* Remove focus outline */\n padding: 0; /* Remove any default padding */\n }\n\n .flypay-v2-image {\n display: block; /* Display the image as block to remove any gaps */\n border: none; /* Ensure the image doesn't have a border */\n width: 100%; /* Make the image take full width of the container */\n }\n ";
8681
+ return "\n\t\t\t#widget {\n\t\t\t\tposition: relative;\n\t\t\t}\n\n\t\t\t#loading-overlay {\n\t\t\t\tposition: absolute;\n\t\t\t\twidth: 268px;\n\t\t\t\theight: 74px;\n\t\t\t\tbackground: rgba(255, 255, 255, 0.7);\n\t\t\t\tdisplay: none;\n\t\t\t\tjustify-content: center;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t#loading-overlay::after {\n\t\t\t\tcontent: \"\";\n\t\t\t\tdisplay: inline-block;\n\t\t\t\twidth: 40px;\n\t\t\t\theight: 40px;\n\t\t\t\tborder: 4px solid #ccc;\n\t\t\t\tborder-top-color: #333;\n\t\t\t\tborder-radius: 50%;\n\n\t\t\t\t/* Vendor prefixes for animation property */\n\t\t\t\t-webkit-animation: spin 1s infinite linear;\n\t\t\t\t-moz-animation: spin 1s infinite linear;\n\t\t\t\t-o-animation: spin 1s infinite linear;\n\t\t\t\tanimation: spin 1s infinite linear;\n\t\t\t}\n\n\t\t\t@-webkit-keyframes spin {\n\t\t\t\t0% {\n\t\t\t\t-webkit-transform: rotate(0deg);\n\t\t\t\ttransform: rotate(0deg);\n\t\t\t\t}\n\t\t\t\t100% {\n\t\t\t\t-webkit-transform: rotate(360deg);\n\t\t\t\ttransform: rotate(360deg);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@-moz-keyframes spin {\n\t\t\t\t0% {\n\t\t\t\t-moz-transform: rotate(0deg);\n\t\t\t\ttransform: rotate(0deg);\n\t\t\t\t}\n\t\t\t\t100% {\n\t\t\t\t-moz-transform: rotate(360deg);\n\t\t\t\ttransform: rotate(360deg);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@-o-keyframes spin {\n\t\t\t\t0% {\n\t\t\t\t-o-transform: rotate(0deg);\n\t\t\t\ttransform: rotate(0deg);\n\t\t\t\t}\n\t\t\t\t100% {\n\t\t\t\t-o-transform: rotate(360deg);\n\t\t\t\ttransform: rotate(360deg);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@keyframes spin {\n\t\t\t\t0% {\n\t\t\t\ttransform: rotate(0deg);\n\t\t\t\t}\n\t\t\t\t100% {\n\t\t\t\ttransform: rotate(360deg);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.flypay-v2-checkout-btn {\n\t\t\t\tborder: none; /* Remove borders */\n\t\t\t\tbackground: transparent; /* Make the button background transparent */\n\t\t\t\tcursor: pointer; /* Make it look clickable */\n\t\t\t\toutline: none; /* Remove focus outline */\n\t\t\t\tpadding: 0; /* Remove any default padding */\n\t\t\t}\n\n\t\t\t.flypay-v2-image {\n\t\t\t\tdisplay: block; /* Display the image as block to remove any gaps */\n\t\t\t\tborder: none; /* Ensure the image doesn't have a border */\n\t\t\t\twidth: 100%; /* Make the image take full width of the container */\n\t\t\t}\n\t\t";
8666
8682
  }
8667
8683
  }, {
8668
8684
  key: "getOrderId",
@@ -8671,7 +8687,7 @@
8671
8687
  return new Promise(function (resolve, reject) {
8672
8688
  return _this2.eventEmitter.emit(WALLET_EVENT.CALLBACK, {
8673
8689
  data: {
8674
- request_type: "CREATE_SESSION"
8690
+ request_type: 'CREATE_SESSION'
8675
8691
  },
8676
8692
  onSuccess: function onSuccess(res) {
8677
8693
  return resolve(res.id);
@@ -8686,17 +8702,21 @@
8686
8702
  key: "flypayV2Checkout",
8687
8703
  value: function flypayV2Checkout(orderId) {
8688
8704
  var _this3 = this;
8689
- this.checkout = new Checkout(_extends(_extends(_extends({
8705
+ var _a, _b;
8706
+ this.checkout = new Checkout(_extends(_extends({
8690
8707
  orderId: orderId
8691
- }, this.accessToken && {
8692
- accessToken: this.accessToken
8693
- }), this.refreshToken && {
8694
- refreshToken: this.refreshToken
8708
+ }, (this.accessToken || this.refreshToken) && {
8709
+ auth: _extends(_extends({}, this.accessToken && {
8710
+ access_token: this.accessToken
8711
+ }), this.refreshToken && {
8712
+ refresh_token: this.refreshToken
8713
+ }),
8714
+ mode: "express"
8695
8715
  }), {
8696
- clientId: '633727af-5bd2-4733-8e08-04074a98300d',
8697
- url: 'https://checkout.release.cxbflypay.com.au',
8716
+ clientId: ((_a = this.meta) === null || _a === void 0 ? void 0 : _a.gateway_mode) === 'live' ? 'dbbd114e-3583-4db5-915e-59f1b3dcd08b' : '924ac1ce-00f4-44e4-8277-06cae751ef1a',
8717
+ url: ((_b = this.meta) === null || _b === void 0 ? void 0 : _b.gateway_mode) === 'live' ? 'https://checkout.beem.com.au' : 'https://release.checkout.beem.com.au',
8698
8718
  onCheckoutClosed: function onCheckoutClosed() {
8699
- var button = document.getElementById("flypay-v2-button");
8719
+ var button = document.getElementById('flypay-v2-button');
8700
8720
  if (button) button.disabled = false;
8701
8721
  },
8702
8722
  onError: function onError(err) {
@@ -8717,6 +8737,10 @@
8717
8737
  refreshToken = _ref.refreshToken;
8718
8738
  _this3.accessToken = accessToken;
8719
8739
  _this3.refreshToken = refreshToken;
8740
+ _this3.eventEmitter.emit(WALLET_EVENT.AUTH_TOKENS_CHANGED, {
8741
+ accessToken: accessToken,
8742
+ refreshToken: refreshToken
8743
+ });
8720
8744
  }
8721
8745
  }));
8722
8746
  this.checkout.open();
@@ -8741,7 +8765,8 @@
8741
8765
  UPDATE: "update",
8742
8766
  PAYMENT_SUCCESSFUL: "paymentSuccessful",
8743
8767
  PAYMENT_ERROR: "paymentError",
8744
- PAYMENT_IN_REVIEW: "paymentInReview"
8768
+ PAYMENT_IN_REVIEW: "paymentInReview",
8769
+ AUTH_TOKENS_CHANGED: "authTokensChanged"
8745
8770
  };
8746
8771
  /**
8747
8772
  * Interface of data used by the wallet checkout and payment proccess.
@@ -9151,6 +9176,33 @@
9151
9176
  });
9152
9177
  });
9153
9178
  }
9179
+ /**
9180
+ * Registers a callback function to be invoked when authentication tokens are changed.
9181
+ * This function allows you to respond to changes in authentication tokens, such as when a user logs in.
9182
+ *
9183
+ * @example
9184
+ * button.onAuthTokensChanged((eventData) => {
9185
+ * console.log('Authentication tokens changed:', eventData);
9186
+ * });
9187
+ *
9188
+ * @example
9189
+ * button.onAuthTokensChanged().then((eventData) => {
9190
+ * console.log('Authentication tokens changed:', eventData);
9191
+ * });
9192
+ *
9193
+ * @param {listener} [handler] - Function to be called when authentication tokens are changed.
9194
+ */
9195
+ }, {
9196
+ key: "onAuthTokensChanged",
9197
+ value: function onAuthTokensChanged(handler) {
9198
+ var _this7 = this;
9199
+ if (typeof handler === 'function') return this.eventEmitter.subscribe(EVENT$1.AUTH_TOKENS_CHANGED, handler);
9200
+ return new Promise(function (resolve) {
9201
+ return _this7.eventEmitter.subscribe(EVENT$1.AUTH_TOKENS_CHANGED, function (err) {
9202
+ return resolve(err);
9203
+ });
9204
+ });
9205
+ }
9154
9206
  }, {
9155
9207
  key: "setupServiceCallbacks",
9156
9208
  value: function setupServiceCallbacks() {
@@ -9161,13 +9213,14 @@
9161
9213
  this.setupPaymentSuccessCallback();
9162
9214
  this.setupPaymentInReviewCallback();
9163
9215
  this.setupPaymentErrorCallback();
9216
+ this.setupAuthTokensChangedCallback();
9164
9217
  }
9165
9218
  }, {
9166
9219
  key: "setupUnavailableCallback",
9167
9220
  value: function setupUnavailableCallback() {
9168
- var _this7 = this;
9221
+ var _this8 = this;
9169
9222
  this.service.on(WALLET_EVENT.UNAVAILABLE, function (eventData) {
9170
- return _this7.eventEmitter.emit(EVENT$1.UNAVAILABLE, {
9223
+ return _this8.eventEmitter.emit(EVENT$1.UNAVAILABLE, {
9171
9224
  event: EVENT$1.UNAVAILABLE,
9172
9225
  data: eventData
9173
9226
  });
@@ -9176,12 +9229,12 @@
9176
9229
  }, {
9177
9230
  key: "setupUpdateCallback",
9178
9231
  value: function setupUpdateCallback() {
9179
- var _this8 = this;
9232
+ var _this9 = this;
9180
9233
  this.service.on(WALLET_EVENT.UPDATE, function (eventData) {
9181
- return _this8.hasUpdateHandler ? _this8.eventEmitter.emit(EVENT$1.UPDATE, {
9234
+ return _this9.hasUpdateHandler ? _this9.eventEmitter.emit(EVENT$1.UPDATE, {
9182
9235
  event: EVENT$1.UPDATE,
9183
9236
  data: eventData
9184
- }) : _this8.update({
9237
+ }) : _this9.update({
9185
9238
  success: true
9186
9239
  });
9187
9240
  });
@@ -9189,12 +9242,12 @@
9189
9242
  }, {
9190
9243
  key: "setupWalletCallback",
9191
9244
  value: function setupWalletCallback() {
9192
- var _this9 = this;
9245
+ var _this10 = this;
9193
9246
  this.service.on(WALLET_EVENT.CALLBACK, function (eventData) {
9194
9247
  var data = eventData.data,
9195
9248
  onSuccess = eventData.onSuccess,
9196
9249
  onError = eventData.onError;
9197
- _this9.api.charge().walletCallback(data).then(function (res) {
9250
+ _this10.api.charge().walletCallback(data).then(function (res) {
9198
9251
  return onSuccess(res);
9199
9252
  }, function (err) {
9200
9253
  return onError(err.message);
@@ -9204,15 +9257,15 @@
9204
9257
  }, {
9205
9258
  key: "setupPaymentCallback",
9206
9259
  value: function setupPaymentCallback() {
9207
- var _this10 = this;
9260
+ var _this11 = this;
9208
9261
  this.service.on(WALLET_EVENT.PAYMENT_METHOD_SELECTED, function (eventData) {
9209
9262
  var data = eventData.data,
9210
9263
  onSuccess = eventData.onSuccess,
9211
9264
  onError = eventData.onError;
9212
- _this10.api.charge().walletCapture(data).then(function (captureResult) {
9265
+ _this11.api.charge().walletCapture(data).then(function (captureResult) {
9213
9266
  if (typeof onSuccess === 'function') onSuccess();
9214
9267
  var event = captureResult.status === 'inreview' ? EVENT$1.PAYMENT_IN_REVIEW : EVENT$1.PAYMENT_SUCCESSFUL;
9215
- _this10.eventEmitter.emit(event, {
9268
+ _this11.eventEmitter.emit(event, {
9216
9269
  event: event,
9217
9270
  data: _extends(_extends({}, captureResult), data.customer && {
9218
9271
  payer_name: data.customer.payer_name,
@@ -9222,7 +9275,7 @@
9222
9275
  });
9223
9276
  }, function (err) {
9224
9277
  if (typeof onError === 'function') onError(err);
9225
- _this10.eventEmitter.emit(EVENT$1.PAYMENT_ERROR, {
9278
+ _this11.eventEmitter.emit(EVENT$1.PAYMENT_ERROR, {
9226
9279
  event: EVENT$1.PAYMENT_ERROR,
9227
9280
  data: err
9228
9281
  });
@@ -9232,9 +9285,9 @@
9232
9285
  }, {
9233
9286
  key: "setupPaymentSuccessCallback",
9234
9287
  value: function setupPaymentSuccessCallback() {
9235
- var _this11 = this;
9288
+ var _this12 = this;
9236
9289
  this.service.on(WALLET_EVENT.PAYMENT_SUCCESS, function (eventData) {
9237
- return _this11.eventEmitter.emit(EVENT$1.PAYMENT_SUCCESSFUL, {
9290
+ return _this12.eventEmitter.emit(EVENT$1.PAYMENT_SUCCESSFUL, {
9238
9291
  event: EVENT$1.PAYMENT_SUCCESSFUL,
9239
9292
  data: eventData
9240
9293
  });
@@ -9243,9 +9296,9 @@
9243
9296
  }, {
9244
9297
  key: "setupPaymentInReviewCallback",
9245
9298
  value: function setupPaymentInReviewCallback() {
9246
- var _this12 = this;
9299
+ var _this13 = this;
9247
9300
  this.service.on(WALLET_EVENT.PAYMENT_IN_REVIEW, function (eventData) {
9248
- return _this12.eventEmitter.emit(EVENT$1.PAYMENT_IN_REVIEW, {
9301
+ return _this13.eventEmitter.emit(EVENT$1.PAYMENT_IN_REVIEW, {
9249
9302
  event: EVENT$1.PAYMENT_IN_REVIEW,
9250
9303
  data: eventData
9251
9304
  });
@@ -9254,14 +9307,25 @@
9254
9307
  }, {
9255
9308
  key: "setupPaymentErrorCallback",
9256
9309
  value: function setupPaymentErrorCallback() {
9257
- var _this13 = this;
9310
+ var _this14 = this;
9258
9311
  this.service.on(WALLET_EVENT.PAYMENT_ERROR, function (eventData) {
9259
- return _this13.eventEmitter.emit(EVENT$1.PAYMENT_ERROR, {
9312
+ return _this14.eventEmitter.emit(EVENT$1.PAYMENT_ERROR, {
9260
9313
  event: EVENT$1.PAYMENT_ERROR,
9261
9314
  data: eventData
9262
9315
  });
9263
9316
  });
9264
9317
  }
9318
+ }, {
9319
+ key: "setupAuthTokensChangedCallback",
9320
+ value: function setupAuthTokensChangedCallback() {
9321
+ var _this15 = this;
9322
+ this.service.on(WALLET_EVENT.AUTH_TOKENS_CHANGED, function (eventData) {
9323
+ return _this15.eventEmitter.emit(EVENT$1.AUTH_TOKENS_CHANGED, {
9324
+ event: EVENT$1.AUTH_TOKENS_CHANGED,
9325
+ data: eventData
9326
+ });
9327
+ });
9328
+ }
9265
9329
  }]);
9266
9330
  return WalletButtons;
9267
9331
  }();