@paydock/client-sdk 1.143.0-beta → 1.144.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.
Files changed (72) hide show
  1. package/README.md +158 -0
  2. package/bundles/index.cjs +523 -312
  3. package/bundles/index.cjs.d.ts +751 -116
  4. package/bundles/index.mjs +518 -313
  5. package/bundles/index.mjs.d.ts +751 -116
  6. package/bundles/types/api/api-charge-internal.d.ts +3 -49
  7. package/bundles/types/api/api-charge-internal.d.ts.map +1 -1
  8. package/bundles/types/api/api-checkout-internal.d.ts +1 -47
  9. package/bundles/types/api/api-checkout-internal.d.ts.map +1 -1
  10. package/bundles/types/api/api-shared-types.d.ts +53 -0
  11. package/bundles/types/api/api-shared-types.d.ts.map +1 -0
  12. package/bundles/types/canvas-3ds/canvas-3ds-event-map.d.ts +95 -0
  13. package/bundles/types/canvas-3ds/canvas-3ds-event-map.d.ts.map +1 -0
  14. package/bundles/types/canvas-3ds/canvas-3ds.d.ts +10 -7
  15. package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -1
  16. package/bundles/types/canvas-3ds/index.d.ts +4 -0
  17. package/bundles/types/canvas-3ds/index.d.ts.map +1 -1
  18. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts +41 -12
  19. package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -1
  20. package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts +20 -2
  21. package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +1 -1
  22. package/bundles/types/checkout/checkout-event-map.d.ts +43 -0
  23. package/bundles/types/checkout/checkout-event-map.d.ts.map +1 -0
  24. package/bundles/types/checkout/checkout.d.ts +25 -9
  25. package/bundles/types/checkout/checkout.d.ts.map +1 -1
  26. package/bundles/types/checkout/v1/instructions/instruction.canvas_3ds.show.d.ts.map +1 -1
  27. package/bundles/types/checkout/v3/instructions/instruction.canvas_3ds.show.d.ts.map +1 -1
  28. package/bundles/types/components/param.d.ts +29 -0
  29. package/bundles/types/components/param.d.ts.map +1 -1
  30. package/bundles/types/helper/event-error.d.ts +49 -1
  31. package/bundles/types/helper/event-error.d.ts.map +1 -1
  32. package/bundles/types/index-cba.d.ts +3 -1
  33. package/bundles/types/index-cba.d.ts.map +1 -1
  34. package/bundles/types/index.d.ts +12 -1
  35. package/bundles/types/index.d.ts.map +1 -1
  36. package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts +37 -0
  37. package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts.map +1 -1
  38. package/bundles/types/open-wallets/base/open-wallet.service.d.ts +12 -0
  39. package/bundles/types/open-wallets/base/open-wallet.service.d.ts.map +1 -1
  40. package/bundles/types/open-wallets/google-pay-open-wallet-button.d.ts.map +1 -1
  41. package/bundles/types/open-wallets/index.d.ts +25 -0
  42. package/bundles/types/open-wallets/index.d.ts.map +1 -1
  43. package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-payment-request.interface.d.ts +2 -2
  44. package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-payment-request.interface.d.ts.map +1 -1
  45. package/bundles/types/open-wallets/interfaces/apple-pay/index.d.ts +1 -1
  46. package/bundles/types/open-wallets/interfaces/apple-pay/index.d.ts.map +1 -1
  47. package/bundles/types/open-wallets/interfaces/events.interface.d.ts +1 -1
  48. package/bundles/types/open-wallets/interfaces/events.interface.d.ts.map +1 -1
  49. package/bundles/types/open-wallets/interfaces/google-pay/google-pay-meta.interface.d.ts +46 -0
  50. package/bundles/types/open-wallets/interfaces/google-pay/google-pay-meta.interface.d.ts.map +1 -1
  51. package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts +48 -2
  52. package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts.map +1 -1
  53. package/bundles/types/open-wallets/services/google-pay/google-pay.open-wallet.service.d.ts.map +1 -1
  54. package/bundles/types/open-wallets/types/index.d.ts +1 -1
  55. package/bundles/types/open-wallets/types/index.d.ts.map +1 -1
  56. package/bundles/types/open-wallets/types/payment-source.type.d.ts +104 -0
  57. package/bundles/types/open-wallets/types/payment-source.type.d.ts.map +1 -1
  58. package/bundles/types/wallet-buttons/interfaces.d.ts +55 -1
  59. package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -1
  60. package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts +7 -0
  61. package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts.map +1 -1
  62. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts +23 -0
  63. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -1
  64. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +31 -0
  65. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -1
  66. package/bundles/widget.umd.js +523 -312
  67. package/bundles/widget.umd.js.d.ts +751 -116
  68. package/bundles/widget.umd.js.min.d.ts +751 -116
  69. package/bundles/widget.umd.min.js +1 -1
  70. package/docs/api-canvas3ds.md +19 -12
  71. package/docs/open-wallet-buttons.md +158 -0
  72. package/package.json +1 -1
package/bundles/index.mjs CHANGED
@@ -1192,7 +1192,7 @@ SDK.headerKeys = Object.freeze({
1192
1192
  version: 'x-sdk-version',
1193
1193
  type: 'x-sdk-type'
1194
1194
  });
1195
- SDK._version = 'v1.143.0-beta';
1195
+ SDK._version = 'v1.144.0-beta';
1196
1196
 
1197
1197
  function isFunction(value) {
1198
1198
  return typeof value === 'function';
@@ -4802,127 +4802,162 @@ var Api = /*#__PURE__*/function (_ApiBase) {
4802
4802
  }]);
4803
4803
  }(ApiBase);
4804
4804
 
4805
- var Url = /*#__PURE__*/function () {
4806
- function Url() {
4807
- _classCallCheck(this, Url);
4805
+ var WALLET_CAPTURE_LINK = '/v1/charges/wallet/capture';
4806
+ var WALLET_CALLBACK_LINK = '/v1/charges/wallet/callback';
4807
+ var STANDALONE_3DS_PROCESS_LINK = '/v1/charges/standalone-3ds/process';
4808
+ var STANDALONE_3DS_HANDLE_LINK = '/v1/charges/standalone-3ds/handle';
4809
+ var ApiChargeInternal = /*#__PURE__*/function () {
4810
+ function ApiChargeInternal(api) {
4811
+ _classCallCheck(this, ApiChargeInternal);
4812
+ this.api = api;
4808
4813
  }
4809
- return _createClass(Url, null, [{
4810
- key: "extendSearchParams",
4811
- value: function extendSearchParams(uri, key, val) {
4812
- return uri.replace(new RegExp("([?&]" + key + "(?=[=&#]|$)[^#&]*|(?=#|$))"), "&" + key + "=" + encodeURIComponent(val)).replace(/^([^?&]+)&/, "$1?");
4814
+ return _createClass(ApiChargeInternal, [{
4815
+ key: "walletCapture",
4816
+ value: function walletCapture(payload) {
4817
+ return this.api.getClientPromise('POST', WALLET_CAPTURE_LINK).send(payload);
4813
4818
  }
4814
4819
  }, {
4815
- key: "serialize",
4816
- value: function serialize(params) {
4817
- return Object.keys(params).map(function (key) {
4818
- return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);
4819
- }).join('&');
4820
+ key: "walletCallback",
4821
+ value: function walletCallback(payload) {
4822
+ return this.api.getClientPromise('POST', WALLET_CALLBACK_LINK).send(payload);
4823
+ }
4824
+ }, {
4825
+ key: "standalone3dsProcess",
4826
+ value: function standalone3dsProcess(payload) {
4827
+ return this.api.getClientPromise('POST', STANDALONE_3DS_PROCESS_LINK).send(payload);
4828
+ }
4829
+ }, {
4830
+ key: "standalone3dsHandle",
4831
+ value: function standalone3dsHandle() {
4832
+ return this.api.getClientPromise('GET', STANDALONE_3DS_HANDLE_LINK).send(undefined);
4820
4833
  }
4821
4834
  }]);
4822
4835
  }();
4823
4836
 
4824
- var Uuid = /*#__PURE__*/function () {
4825
- function Uuid() {
4826
- _classCallCheck(this, Uuid);
4837
+ var CALLBACK_LINK = '/v1/checkouts/callback';
4838
+ var INSTRUCTION_LINK = '/v1/checkouts/instruction';
4839
+ var STATUS_LINK = '/v1/checkouts';
4840
+ var ApiCheckoutInternal = /*#__PURE__*/function () {
4841
+ function ApiCheckoutInternal(api) {
4842
+ _classCallCheck(this, ApiCheckoutInternal);
4843
+ this.api = api;
4844
+ this.getInstructionLink = function () {
4845
+ return "".concat(INSTRUCTION_LINK, "?time=").concat(Date.now());
4846
+ };
4827
4847
  }
4828
- return _createClass(Uuid, null, [{
4829
- key: "generate",
4830
- value: function generate() {
4831
- if (typeof window !== "undefined" && typeof window.crypto !== "undefined" && typeof window.crypto.getRandomValues !== "undefined") {
4832
- var buf = new Uint16Array(8);
4833
- window.crypto.getRandomValues(buf);
4834
- return this.hash(buf[0]) + this.hash(buf[1]) + "-" + this.hash(buf[2]) + "-" + this.hash(buf[3]) + "-" + this.hash(buf[4]) + "-" + this.hash(buf[5]) + this.hash(buf[6]) + this.hash(buf[7]);
4835
- } else {
4836
- return this.random() + this.random() + "-" + this.random() + "-" + this.random() + "-" + this.random() + "-" + this.random() + this.random() + this.random();
4837
- }
4848
+ return _createClass(ApiCheckoutInternal, [{
4849
+ key: "instructions",
4850
+ value: function instructions() {
4851
+ return this.api.requestObservable('GET', this.getInstructionLink(), {});
4838
4852
  }
4839
4853
  }, {
4840
- key: "hash",
4841
- value: function hash(number) {
4842
- var hash = number.toString(16);
4843
- while (hash.length < 4) {
4844
- hash = "0" + hash;
4845
- }
4846
- return hash;
4854
+ key: "callback",
4855
+ value: function callback(payload) {
4856
+ return this.api.getClientPromise('POST', CALLBACK_LINK).send(payload);
4847
4857
  }
4848
4858
  }, {
4849
- key: "random",
4850
- value: function random() {
4851
- return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
4859
+ key: "status",
4860
+ value: function status(id) {
4861
+ return this.api.getClientPromise('GET', "".concat(STATUS_LINK, "/").concat(id)).send('');
4852
4862
  }
4853
4863
  }]);
4854
4864
  }();
4855
4865
 
4856
- var WIDGET_LINK = '/remote-action';
4857
- var VAULT_DISPLAY_WIDGET_LINK = '/vault-display';
4858
- var PAYMENT_SOURCE_LINK = '/payment-sources';
4859
- var SECURE_3D = '/3ds/webhook';
4860
- var FLYPAY_LINK = '/wallet/flypay';
4861
- var FLYPAY_LOGO_LINK = '/images/coles-pay-logo.png';
4862
- var MESSAGE_WIDGET_LINK = '/message-widget';
4863
- var MASTERCARD_SRC = '/secure-remote-commerce/mastercard';
4864
- var Link = /*#__PURE__*/function () {
4865
- function Link(linkResource) {
4866
- _classCallCheck(this, Link);
4867
- this.params = {};
4868
- this.widgetId = Uuid.generate();
4869
- this.linkResource = linkResource;
4870
- this.env = new Env(WIDGET_URL);
4871
- this.setParams({
4872
- widget_id: this.widgetId
4873
- });
4866
+ var GET_WALLET_CONFIG = '/v1/gateways/:gateway_id/wallet-config';
4867
+ var ApiGatewayInternal = /*#__PURE__*/function () {
4868
+ function ApiGatewayInternal(api) {
4869
+ _classCallCheck(this, ApiGatewayInternal);
4870
+ this.api = api;
4874
4871
  }
4875
- return _createClass(Link, [{
4876
- key: "getNetUrl",
4877
- value: function getNetUrl() {
4878
- return this.env.getConf().url + this.linkResource;
4872
+ return _createClass(ApiGatewayInternal, [{
4873
+ key: "getWalletConfig",
4874
+ value: function getWalletConfig(gateway_id) {
4875
+ var url = GET_WALLET_CONFIG.replace(':gateway_id', gateway_id);
4876
+ return this.api.getClientPromise('GET', url).send(undefined);
4879
4877
  }
4880
- }, {
4881
- key: "getUrl",
4882
- value: function getUrl() {
4883
- var url = this.getNetUrl();
4884
- var params = this.getParams();
4885
- for (var key in params) {
4886
- if (params.hasOwnProperty(key)) url = Url.extendSearchParams(url, key, params[key]);
4887
- }
4888
- return url;
4878
+ }]);
4879
+ }();
4880
+
4881
+ var CREATE_OTT = '/v1/payment_sources/tokens';
4882
+ var CREATE_SESSION = '/v1/payment_sources/payment-session';
4883
+ var ApiPaymentSourceInternal = /*#__PURE__*/function () {
4884
+ function ApiPaymentSourceInternal(api) {
4885
+ _classCallCheck(this, ApiPaymentSourceInternal);
4886
+ this.api = api;
4887
+ }
4888
+ return _createClass(ApiPaymentSourceInternal, [{
4889
+ key: "createOTT",
4890
+ value: function createOTT(payload) {
4891
+ return this.api.getClientPromise('POST', CREATE_OTT).send(payload);
4889
4892
  }
4890
4893
  }, {
4891
- key: "setParams",
4892
- value: function setParams(params) {
4893
- this.params = _extends({}, this.params, params);
4894
+ key: "createSession",
4895
+ value: function createSession(payload) {
4896
+ return this.api.getClientPromise('POST', CREATE_SESSION).send(payload);
4894
4897
  }
4895
- }, {
4896
- key: "concatParams",
4897
- value: function concatParams(params) {
4898
- for (var key in params) {
4899
- if (!params.hasOwnProperty(key) || !params[key].length) continue;
4900
- if (typeof this.params[key] !== 'string') this.params[key] = '';
4901
- if (this.params[key].length) this.params[key] += ',' + params[key];else this.params[key] += params[key];
4902
- }
4898
+ }]);
4899
+ }();
4900
+
4901
+ var GET_CONFIG = '/v1/services/:service_id/config';
4902
+ var ApiServiceInternal = /*#__PURE__*/function () {
4903
+ function ApiServiceInternal(api) {
4904
+ _classCallCheck(this, ApiServiceInternal);
4905
+ this.api = api;
4906
+ }
4907
+ return _createClass(ApiServiceInternal, [{
4908
+ key: "getConfig",
4909
+ value: function getConfig(service_id) {
4910
+ var url = GET_CONFIG.replace(':service_id', service_id);
4911
+ return this.api.getClientPromise('GET', url).send(undefined);
4912
+ }
4913
+ }]);
4914
+ }();
4915
+ var SERVICE_TYPES;
4916
+ (function (SERVICE_TYPES) {
4917
+ SERVICE_TYPES["ACCERTIFY"] = "Accertify";
4918
+ SERVICE_TYPES["BOOKING"] = "Booking";
4919
+ SERVICE_TYPES["GPAYMENTS"] = "GPayments";
4920
+ SERVICE_TYPES["CLICK_TO_PAY"] = "ClickToPay";
4921
+ SERVICE_TYPES["MASTERCARD_NT"] = "MastercardSCOF";
4922
+ SERVICE_TYPES["VISA_NT"] = "VisaVTS";
4923
+ SERVICE_TYPES["FORTER"] = "Forter";
4924
+ SERVICE_TYPES["APPLE_PAY"] = "ApplePay";
4925
+ SERVICE_TYPES["GOOGLE_PAY"] = "GooglePay";
4926
+ })(SERVICE_TYPES || (SERVICE_TYPES = {}));
4927
+
4928
+ var ApiInternal = /*#__PURE__*/function (_ApiBase) {
4929
+ function ApiInternal() {
4930
+ _classCallCheck(this, ApiInternal);
4931
+ return _callSuper(this, ApiInternal, arguments);
4932
+ }
4933
+ _inherits(ApiInternal, _ApiBase);
4934
+ return _createClass(ApiInternal, [{
4935
+ key: "charge",
4936
+ value: function charge() {
4937
+ return new ApiChargeInternal(this);
4903
4938
  }
4904
4939
  }, {
4905
- key: "getParams",
4906
- value: function getParams() {
4907
- return this.params;
4940
+ key: "service",
4941
+ value: function service() {
4942
+ return new ApiServiceInternal(this);
4908
4943
  }
4909
4944
  }, {
4910
- key: "setEnv",
4911
- value: function setEnv(env, alias) {
4912
- this.env.setEnv(env, alias);
4945
+ key: "checkout",
4946
+ value: function checkout() {
4947
+ return new ApiCheckoutInternal(this);
4913
4948
  }
4914
4949
  }, {
4915
- key: "getEnv",
4916
- value: function getEnv() {
4917
- return this.env.getEnv();
4950
+ key: "gateway",
4951
+ value: function gateway() {
4952
+ return new ApiGatewayInternal(this);
4918
4953
  }
4919
4954
  }, {
4920
- key: "getBaseUrl",
4921
- value: function getBaseUrl() {
4922
- return this.env.getConf().url;
4955
+ key: "paymentSource",
4956
+ value: function paymentSource() {
4957
+ return new ApiPaymentSourceInternal(this);
4923
4958
  }
4924
4959
  }]);
4925
- }();
4960
+ }(ApiBase);
4926
4961
 
4927
4962
  var IFrame = /*#__PURE__*/function () {
4928
4963
  function IFrame(container) {
@@ -5119,10 +5154,10 @@ var IFrameEvent = /*#__PURE__*/function () {
5119
5154
  }();
5120
5155
 
5121
5156
  var hiddenStyle = {
5122
- visibility: "hidden",
5123
- border: "0",
5124
- width: "0",
5125
- height: "0"
5157
+ visibility: 'hidden',
5158
+ border: '0',
5159
+ width: '0',
5160
+ height: '0'
5126
5161
  };
5127
5162
  var PROCESS_STANDALONE_3DS_STATUS;
5128
5163
  (function (PROCESS_STANDALONE_3DS_STATUS) {
@@ -5144,14 +5179,30 @@ var IFRAME_STATUS;
5144
5179
  IFRAME_STATUS["TIMEOUT"] = "AuthTimedOut";
5145
5180
  IFRAME_STATUS["INVALID"] = "invalid_event";
5146
5181
  })(IFRAME_STATUS || (IFRAME_STATUS = {}));
5182
+ /**
5183
+ * Event name constants emitted during the Standalone 3DS (GPayments) flow.
5184
+ * Used internally by `GPaymentsService` and re-exported publicly as `CANVAS_3DS_EVENT`.
5185
+ */
5147
5186
  var GPAYMENTS_EVENT = {
5187
+ /** Authentication succeeded. Payload: `Canvas3dsAuthPayload`. */
5148
5188
  AUTH_SUCCESS: 'chargeAuthSuccess',
5189
+ /** Authentication failed — covers issuer rejection, iframe timeout (`AuthTimedOut`), and invalid-event outcomes. Payload: `Canvas3dsAuthPayload`. */
5149
5190
  AUTH_ERROR: 'chargeAuthReject',
5191
+ /** Decoupled authentication — issuer will authenticate out-of-band. Payload: `Canvas3dsAuthPayload`. */
5150
5192
  DECOUPLED: 'chargeAuthDecoupled',
5193
+ /** Challenge required — issuer demands user interaction. Payload: `Canvas3dsAuthPayload`. */
5151
5194
  CHALLENGE: 'chargeAuthChallenge',
5195
+ /** Informational signal emitted by the GPayments flow. Internal — not part of the public typed surface. */
5152
5196
  INFO: 'chargeAuthInfo',
5197
+ /** Error during the flow (network, parsing, etc.). Payload: `Canvas3dsErrorPayload`. */
5153
5198
  ERROR: 'error'
5154
5199
  };
5200
+ /**
5201
+ * Public alias for GPAYMENTS_EVENT. Same object reference — no behavioral change.
5202
+ * Prefer `CANVAS_3DS_EVENT` in public-facing code; `GPAYMENTS_EVENT` remains for
5203
+ * backwards-compatible internal usage.
5204
+ */
5205
+ var CANVAS_3DS_EVENT = GPAYMENTS_EVENT;
5155
5206
  var GPaymentsService = /*#__PURE__*/function () {
5156
5207
  function GPaymentsService(container, api, eventEmitter) {
5157
5208
  _classCallCheck(this, GPaymentsService);
@@ -5179,20 +5230,22 @@ var GPaymentsService = /*#__PURE__*/function () {
5179
5230
  value: function initializeIFrames(initializationUrl, secondaryUrl, title) {
5180
5231
  var hideAuthorization = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
5181
5232
  var container = this.container.getElement();
5182
- if (!container) return;
5183
- var divAuthorization = document.createElement("div");
5184
- divAuthorization.setAttribute("id", "paydock_authorization_iframe");
5233
+ if (!container) {
5234
+ return;
5235
+ }
5236
+ var divAuthorization = document.createElement('div');
5237
+ divAuthorization.setAttribute('id', 'paydock_authorization_iframe');
5185
5238
  container.appendChild(divAuthorization);
5186
- this.browserAndChallengeContainer = new Container("#paydock_authorization_iframe");
5239
+ this.browserAndChallengeContainer = new Container('#paydock_authorization_iframe');
5187
5240
  this.iFrameAuthorization = new IFrame(this.browserAndChallengeContainer);
5188
5241
  this.iFrameAuthorization.load(initializationUrl, {
5189
5242
  title: title
5190
5243
  });
5191
5244
  if (secondaryUrl) {
5192
- var divSecondaryURL = document.createElement("div");
5193
- divSecondaryURL.setAttribute("id", "paydock_secondary_iframe");
5245
+ var divSecondaryURL = document.createElement('div');
5246
+ divSecondaryURL.setAttribute('id', 'paydock_secondary_iframe');
5194
5247
  container.appendChild(divSecondaryURL);
5195
- this.monitoringContainer = new Container("#paydock_secondary_iframe");
5248
+ this.monitoringContainer = new Container('#paydock_secondary_iframe');
5196
5249
  this.iFrameSecondaryUrl = new IFrame(this.monitoringContainer);
5197
5250
  this.iFrameSecondaryUrl.load(secondaryUrl, {
5198
5251
  title: title
@@ -5208,8 +5261,12 @@ var GPaymentsService = /*#__PURE__*/function () {
5208
5261
  var hideAuthorization = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
5209
5262
  var _a;
5210
5263
  for (var prop in hiddenStyle) {
5211
- if (!hiddenStyle.hasOwnProperty(prop)) continue;
5212
- if (hideAuthorization) this.iFrameAuthorization.setStyle(prop, hiddenStyle[prop]);
5264
+ if (!Object.hasOwn(hiddenStyle, prop)) {
5265
+ continue;
5266
+ }
5267
+ if (hideAuthorization) {
5268
+ this.iFrameAuthorization.setStyle(prop, hiddenStyle[prop]);
5269
+ }
5213
5270
  (_a = this.iFrameSecondaryUrl) === null || _a === void 0 ? void 0 : _a.setStyle(prop, hiddenStyle[prop]);
5214
5271
  }
5215
5272
  }
@@ -5219,13 +5276,17 @@ var GPaymentsService = /*#__PURE__*/function () {
5219
5276
  var _this = this;
5220
5277
  this.iFrameEvent.on(EVENT$5.CHARGE_AUTH, widgetId, function (data) {
5221
5278
  if (data.status === IFRAME_STATUS.SKIPPED || data.status === IFRAME_STATUS.FINISHED) {
5222
- if (data.info) _this.eventEmitter.emit(GPAYMENTS_EVENT.INFO, {
5223
- info: data.info
5224
- });
5279
+ if (data.info) {
5280
+ _this.eventEmitter.emit(GPAYMENTS_EVENT.INFO, {
5281
+ info: data.info
5282
+ });
5283
+ }
5225
5284
  _this.performAuthentication(data);
5226
- } else if (data.status === IFRAME_STATUS.TIMEOUT || data.status === IFRAME_STATUS.INVALID) _this.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_ERROR, _this.parseHandleResponse({
5227
- status: data.status
5228
- }, data.charge_3ds_id));
5285
+ } else if (data.status === IFRAME_STATUS.TIMEOUT || data.status === IFRAME_STATUS.INVALID) {
5286
+ _this.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_ERROR, _this.parseHandleResponse({
5287
+ status: data.status
5288
+ }, data.charge_3ds_id));
5289
+ }
5229
5290
  });
5230
5291
  this.iFrameEvent.on(EVENT$5.CHARGE_AUTH_SUCCESS, widgetId, function (data) {
5231
5292
  _this.processResult(data.charge_3ds_id);
@@ -5265,13 +5326,19 @@ var GPaymentsService = /*#__PURE__*/function () {
5265
5326
  key: "processResult",
5266
5327
  value: function processResult(charge3dsId) {
5267
5328
  var _this2 = this;
5268
- if (this.resultRead) return;
5329
+ if (this.resultRead) {
5330
+ return;
5331
+ }
5269
5332
  this.resultRead = true;
5270
5333
  this.api.charge().standalone3dsHandle().then(function (result) {
5271
5334
  var _a;
5272
5335
  _this2.iFrameAuthorization.remove();
5273
5336
  (_a = _this2.iFrameSecondaryUrl) === null || _a === void 0 ? void 0 : _a.remove();
5274
- if (result.status === PROCESS_STANDALONE_3DS_STATUS.SUCCESS) _this2.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_SUCCESS, _this2.parseResultData(result, charge3dsId));else _this2.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_ERROR, _this2.parseResultData(result, charge3dsId));
5337
+ if (result.status === PROCESS_STANDALONE_3DS_STATUS.SUCCESS) {
5338
+ _this2.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_SUCCESS, _this2.parseResultData(result, charge3dsId));
5339
+ } else {
5340
+ _this2.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_ERROR, _this2.parseResultData(result, charge3dsId));
5341
+ }
5275
5342
  }, function (err) {
5276
5343
  _this2.eventEmitter.emit(GPAYMENTS_EVENT.ERROR, _this2.parseError(err, charge3dsId));
5277
5344
  });
@@ -5296,10 +5363,16 @@ var GPaymentsService = /*#__PURE__*/function () {
5296
5363
  key: "doPolling",
5297
5364
  value: function doPolling(url, charge3dsId) {
5298
5365
  var _this3 = this;
5299
- this.externalAPI("GET", url).then(function (data) {
5300
- if (!data.event || data.event === "AuthResultNotReady") setTimeout(function () {
5301
- _this3.doPolling(url, charge3dsId);
5302
- }, 2000);else if (data.event === 'AuthResultReady') _this3.processResult(charge3dsId);else throw new Error("Event not supported");
5366
+ this.externalAPI('GET', url).then(function (data) {
5367
+ if (!data.event || data.event === 'AuthResultNotReady') {
5368
+ setTimeout(function () {
5369
+ _this3.doPolling(url, charge3dsId);
5370
+ }, 2000);
5371
+ } else if (data.event === 'AuthResultReady') {
5372
+ _this3.processResult(charge3dsId);
5373
+ } else {
5374
+ throw new Error('Event not supported');
5375
+ }
5303
5376
  })["catch"](function (err) {
5304
5377
  return _this3.eventEmitter.emit(GPAYMENTS_EVENT.ERROR, _this3.parseError(err, charge3dsId));
5305
5378
  });
@@ -5316,16 +5389,24 @@ var GPaymentsService = /*#__PURE__*/function () {
5316
5389
  charge_3ds_id: charge_3ds_id
5317
5390
  }).then(function (authenticationResult) {
5318
5391
  var _a, _b;
5319
- if (authenticationResult.status === AUTHENTICATION_STATUS.SUCCESS) _this4.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_SUCCESS, _this4.parseHandleResponse(authenticationResult, charge_3ds_id));else if (authenticationResult.status === AUTHENTICATION_STATUS.PENDING) {
5392
+ if (authenticationResult.status === AUTHENTICATION_STATUS.SUCCESS) {
5393
+ _this4.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_SUCCESS, _this4.parseHandleResponse(authenticationResult, charge_3ds_id));
5394
+ } else if (authenticationResult.status === AUTHENTICATION_STATUS.PENDING) {
5320
5395
  if ((_a = authenticationResult === null || authenticationResult === void 0 ? void 0 : authenticationResult.result) === null || _a === void 0 ? void 0 : _a.challenge) {
5321
5396
  _this4.eventEmitter.emit(GPAYMENTS_EVENT.CHALLENGE, _this4.parseHandleResponse(authenticationResult, charge_3ds_id));
5322
5397
  _this4.initializeIFrames(authenticationResult.result.challenge_url, undefined, 'Authentication Challenge', false);
5323
- if (authenticationResult.result.secondary_url) _this4.doPolling(authenticationResult.result.secondary_url, charge_3ds_id);
5398
+ if (authenticationResult.result.secondary_url) {
5399
+ _this4.doPolling(authenticationResult.result.secondary_url, charge_3ds_id);
5400
+ }
5324
5401
  } else if ((_b = authenticationResult === null || authenticationResult === void 0 ? void 0 : authenticationResult.result) === null || _b === void 0 ? void 0 : _b.decoupled_challenge) {
5325
5402
  _this4.eventEmitter.emit(GPAYMENTS_EVENT.DECOUPLED, _this4.parseHandleResponse(authenticationResult, charge_3ds_id));
5326
- if (authenticationResult.result.secondary_url) _this4.doPolling(authenticationResult.result.secondary_url, charge_3ds_id);
5403
+ if (authenticationResult.result.secondary_url) {
5404
+ _this4.doPolling(authenticationResult.result.secondary_url, charge_3ds_id);
5405
+ }
5327
5406
  }
5328
- } else return _this4.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_ERROR, _this4.parseHandleResponse(authenticationResult, charge_3ds_id));
5407
+ } else {
5408
+ return _this4.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_ERROR, _this4.parseHandleResponse(authenticationResult, charge_3ds_id));
5409
+ }
5329
5410
  }, function (err) {
5330
5411
  _this4.eventEmitter.emit(GPAYMENTS_EVENT.ERROR, _this4.parseError(err, charge_3ds_id));
5331
5412
  });
@@ -5333,192 +5414,159 @@ var GPaymentsService = /*#__PURE__*/function () {
5333
5414
  }]);
5334
5415
  }();
5335
5416
 
5336
- var WALLET_CAPTURE_LINK = '/v1/charges/wallet/capture';
5337
- var WALLET_CALLBACK_LINK = '/v1/charges/wallet/callback';
5338
- var STANDALONE_3DS_PROCESS_LINK = '/v1/charges/standalone-3ds/process';
5339
- var STANDALONE_3DS_HANDLE_LINK = '/v1/charges/standalone-3ds/handle';
5340
- var ApiChargeInternal = /*#__PURE__*/function () {
5341
- function ApiChargeInternal(api) {
5342
- _classCallCheck(this, ApiChargeInternal);
5343
- this.api = api;
5417
+ var STANDALONE_3DS_GATEWAYS = {
5418
+ GPAYMENTS: 'GPayments'
5419
+ };
5420
+ var Standalone3dsService = /*#__PURE__*/function () {
5421
+ function Standalone3dsService(container, eventEmitter) {
5422
+ _classCallCheck(this, Standalone3dsService);
5423
+ this.env = DEFAULT_ENV;
5424
+ this.container = container;
5425
+ this.eventEmitter = eventEmitter;
5344
5426
  }
5345
- return _createClass(ApiChargeInternal, [{
5346
- key: "walletCapture",
5347
- value: function walletCapture(payload) {
5348
- return this.api.getClientPromise('POST', WALLET_CAPTURE_LINK).send(payload);
5349
- }
5350
- }, {
5351
- key: "walletCallback",
5352
- value: function walletCallback(payload) {
5353
- return this.api.getClientPromise('POST', WALLET_CALLBACK_LINK).send(payload);
5354
- }
5355
- }, {
5356
- key: "standalone3dsProcess",
5357
- value: function standalone3dsProcess(payload) {
5358
- return this.api.getClientPromise('POST', STANDALONE_3DS_PROCESS_LINK).send(payload);
5427
+ return _createClass(Standalone3dsService, [{
5428
+ key: "load",
5429
+ value: function load(token, options) {
5430
+ var parsedToken = AccessToken.validateJWT(token);
5431
+ if (!parsedToken) {
5432
+ throw new Error('Invalid charge token');
5433
+ }
5434
+ var tokenData = AccessToken.extractData(parsedToken.body);
5435
+ var api = new ApiInternal(token, API_AUTH_TYPE.TOKEN);
5436
+ api.setEnv(this.env, this.alias);
5437
+ switch (tokenData.service_type) {
5438
+ case STANDALONE_3DS_GATEWAYS.GPAYMENTS:
5439
+ new GPaymentsService(this.container, api, this.eventEmitter).load(tokenData, options.title);
5440
+ break;
5441
+ }
5359
5442
  }
5360
5443
  }, {
5361
- key: "standalone3dsHandle",
5362
- value: function standalone3dsHandle() {
5363
- return this.api.getClientPromise('GET', STANDALONE_3DS_HANDLE_LINK).send(undefined);
5444
+ key: "setEnv",
5445
+ value: function setEnv(env, alias) {
5446
+ this.env = env;
5447
+ this.alias = alias;
5364
5448
  }
5365
5449
  }]);
5366
5450
  }();
5367
5451
 
5368
- var CALLBACK_LINK = '/v1/checkouts/callback';
5369
- var INSTRUCTION_LINK = '/v1/checkouts/instruction';
5370
- var STATUS_LINK = '/v1/checkouts';
5371
- var ApiCheckoutInternal = /*#__PURE__*/function () {
5372
- function ApiCheckoutInternal(api) {
5373
- _classCallCheck(this, ApiCheckoutInternal);
5374
- this.api = api;
5375
- this.getInstructionLink = function () {
5376
- return "".concat(INSTRUCTION_LINK, "?time=").concat(Date.now());
5377
- };
5452
+ var Url = /*#__PURE__*/function () {
5453
+ function Url() {
5454
+ _classCallCheck(this, Url);
5378
5455
  }
5379
- return _createClass(ApiCheckoutInternal, [{
5380
- key: "instructions",
5381
- value: function instructions() {
5382
- return this.api.requestObservable('GET', this.getInstructionLink(), {});
5383
- }
5384
- }, {
5385
- key: "callback",
5386
- value: function callback(payload) {
5387
- return this.api.getClientPromise('POST', CALLBACK_LINK).send(payload);
5456
+ return _createClass(Url, null, [{
5457
+ key: "extendSearchParams",
5458
+ value: function extendSearchParams(uri, key, val) {
5459
+ return uri.replace(new RegExp("([?&]" + key + "(?=[=&#]|$)[^#&]*|(?=#|$))"), "&" + key + "=" + encodeURIComponent(val)).replace(/^([^?&]+)&/, "$1?");
5388
5460
  }
5389
5461
  }, {
5390
- key: "status",
5391
- value: function status(id) {
5392
- return this.api.getClientPromise('GET', "".concat(STATUS_LINK, "/").concat(id)).send('');
5393
- }
5394
- }]);
5395
- }();
5396
-
5397
- var GET_WALLET_CONFIG = '/v1/gateways/:gateway_id/wallet-config';
5398
- var ApiGatewayInternal = /*#__PURE__*/function () {
5399
- function ApiGatewayInternal(api) {
5400
- _classCallCheck(this, ApiGatewayInternal);
5401
- this.api = api;
5402
- }
5403
- return _createClass(ApiGatewayInternal, [{
5404
- key: "getWalletConfig",
5405
- value: function getWalletConfig(gateway_id) {
5406
- var url = GET_WALLET_CONFIG.replace(':gateway_id', gateway_id);
5407
- return this.api.getClientPromise('GET', url).send(undefined);
5462
+ key: "serialize",
5463
+ value: function serialize(params) {
5464
+ return Object.keys(params).map(function (key) {
5465
+ return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);
5466
+ }).join('&');
5408
5467
  }
5409
5468
  }]);
5410
5469
  }();
5411
5470
 
5412
- var CREATE_OTT = '/v1/payment_sources/tokens';
5413
- var CREATE_SESSION = '/v1/payment_sources/payment-session';
5414
- var ApiPaymentSourceInternal = /*#__PURE__*/function () {
5415
- function ApiPaymentSourceInternal(api) {
5416
- _classCallCheck(this, ApiPaymentSourceInternal);
5417
- this.api = api;
5471
+ var Uuid = /*#__PURE__*/function () {
5472
+ function Uuid() {
5473
+ _classCallCheck(this, Uuid);
5418
5474
  }
5419
- return _createClass(ApiPaymentSourceInternal, [{
5420
- key: "createOTT",
5421
- value: function createOTT(payload) {
5422
- return this.api.getClientPromise('POST', CREATE_OTT).send(payload);
5475
+ return _createClass(Uuid, null, [{
5476
+ key: "generate",
5477
+ value: function generate() {
5478
+ if (typeof window !== "undefined" && typeof window.crypto !== "undefined" && typeof window.crypto.getRandomValues !== "undefined") {
5479
+ var buf = new Uint16Array(8);
5480
+ window.crypto.getRandomValues(buf);
5481
+ return this.hash(buf[0]) + this.hash(buf[1]) + "-" + this.hash(buf[2]) + "-" + this.hash(buf[3]) + "-" + this.hash(buf[4]) + "-" + this.hash(buf[5]) + this.hash(buf[6]) + this.hash(buf[7]);
5482
+ } else {
5483
+ return this.random() + this.random() + "-" + this.random() + "-" + this.random() + "-" + this.random() + "-" + this.random() + this.random() + this.random();
5484
+ }
5423
5485
  }
5424
5486
  }, {
5425
- key: "createSession",
5426
- value: function createSession(payload) {
5427
- return this.api.getClientPromise('POST', CREATE_SESSION).send(payload);
5487
+ key: "hash",
5488
+ value: function hash(number) {
5489
+ var hash = number.toString(16);
5490
+ while (hash.length < 4) {
5491
+ hash = "0" + hash;
5492
+ }
5493
+ return hash;
5428
5494
  }
5429
- }]);
5430
- }();
5431
-
5432
- var GET_CONFIG = '/v1/services/:service_id/config';
5433
- var ApiServiceInternal = /*#__PURE__*/function () {
5434
- function ApiServiceInternal(api) {
5435
- _classCallCheck(this, ApiServiceInternal);
5436
- this.api = api;
5437
- }
5438
- return _createClass(ApiServiceInternal, [{
5439
- key: "getConfig",
5440
- value: function getConfig(service_id) {
5441
- var url = GET_CONFIG.replace(':service_id', service_id);
5442
- return this.api.getClientPromise('GET', url).send(undefined);
5495
+ }, {
5496
+ key: "random",
5497
+ value: function random() {
5498
+ return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
5443
5499
  }
5444
5500
  }]);
5445
5501
  }();
5446
- var SERVICE_TYPES;
5447
- (function (SERVICE_TYPES) {
5448
- SERVICE_TYPES["ACCERTIFY"] = "Accertify";
5449
- SERVICE_TYPES["BOOKING"] = "Booking";
5450
- SERVICE_TYPES["GPAYMENTS"] = "GPayments";
5451
- SERVICE_TYPES["CLICK_TO_PAY"] = "ClickToPay";
5452
- SERVICE_TYPES["MASTERCARD_NT"] = "MastercardSCOF";
5453
- SERVICE_TYPES["VISA_NT"] = "VisaVTS";
5454
- SERVICE_TYPES["FORTER"] = "Forter";
5455
- SERVICE_TYPES["APPLE_PAY"] = "ApplePay";
5456
- SERVICE_TYPES["GOOGLE_PAY"] = "GooglePay";
5457
- })(SERVICE_TYPES || (SERVICE_TYPES = {}));
5458
5502
 
5459
- var ApiInternal = /*#__PURE__*/function (_ApiBase) {
5460
- function ApiInternal() {
5461
- _classCallCheck(this, ApiInternal);
5462
- return _callSuper(this, ApiInternal, arguments);
5503
+ var WIDGET_LINK = '/remote-action';
5504
+ var VAULT_DISPLAY_WIDGET_LINK = '/vault-display';
5505
+ var PAYMENT_SOURCE_LINK = '/payment-sources';
5506
+ var SECURE_3D = '/3ds/webhook';
5507
+ var FLYPAY_LINK = '/wallet/flypay';
5508
+ var FLYPAY_LOGO_LINK = '/images/coles-pay-logo.png';
5509
+ var MESSAGE_WIDGET_LINK = '/message-widget';
5510
+ var MASTERCARD_SRC = '/secure-remote-commerce/mastercard';
5511
+ var Link = /*#__PURE__*/function () {
5512
+ function Link(linkResource) {
5513
+ _classCallCheck(this, Link);
5514
+ this.params = {};
5515
+ this.widgetId = Uuid.generate();
5516
+ this.linkResource = linkResource;
5517
+ this.env = new Env(WIDGET_URL);
5518
+ this.setParams({
5519
+ widget_id: this.widgetId
5520
+ });
5463
5521
  }
5464
- _inherits(ApiInternal, _ApiBase);
5465
- return _createClass(ApiInternal, [{
5466
- key: "charge",
5467
- value: function charge() {
5468
- return new ApiChargeInternal(this);
5522
+ return _createClass(Link, [{
5523
+ key: "getNetUrl",
5524
+ value: function getNetUrl() {
5525
+ return this.env.getConf().url + this.linkResource;
5469
5526
  }
5470
5527
  }, {
5471
- key: "service",
5472
- value: function service() {
5473
- return new ApiServiceInternal(this);
5528
+ key: "getUrl",
5529
+ value: function getUrl() {
5530
+ var url = this.getNetUrl();
5531
+ var params = this.getParams();
5532
+ for (var key in params) {
5533
+ if (params.hasOwnProperty(key)) url = Url.extendSearchParams(url, key, params[key]);
5534
+ }
5535
+ return url;
5474
5536
  }
5475
5537
  }, {
5476
- key: "checkout",
5477
- value: function checkout() {
5478
- return new ApiCheckoutInternal(this);
5538
+ key: "setParams",
5539
+ value: function setParams(params) {
5540
+ this.params = _extends({}, this.params, params);
5479
5541
  }
5480
5542
  }, {
5481
- key: "gateway",
5482
- value: function gateway() {
5483
- return new ApiGatewayInternal(this);
5543
+ key: "concatParams",
5544
+ value: function concatParams(params) {
5545
+ for (var key in params) {
5546
+ if (!params.hasOwnProperty(key) || !params[key].length) continue;
5547
+ if (typeof this.params[key] !== 'string') this.params[key] = '';
5548
+ if (this.params[key].length) this.params[key] += ',' + params[key];else this.params[key] += params[key];
5549
+ }
5484
5550
  }
5485
5551
  }, {
5486
- key: "paymentSource",
5487
- value: function paymentSource() {
5488
- return new ApiPaymentSourceInternal(this);
5489
- }
5490
- }]);
5491
- }(ApiBase);
5492
-
5493
- var STANDALONE_3DS_GATEWAYS = {
5494
- GPAYMENTS: "GPayments"
5495
- };
5496
- var Standalone3dsService = /*#__PURE__*/function () {
5497
- function Standalone3dsService(container, eventEmitter) {
5498
- _classCallCheck(this, Standalone3dsService);
5499
- this.env = DEFAULT_ENV;
5500
- this.container = container;
5501
- this.eventEmitter = eventEmitter;
5502
- }
5503
- return _createClass(Standalone3dsService, [{
5504
- key: "load",
5505
- value: function load(token, options) {
5506
- var parsedToken = AccessToken.validateJWT(token);
5507
- if (!parsedToken) throw new Error("Invalid charge token");
5508
- var tokenData = AccessToken.extractData(parsedToken.body);
5509
- var api = new ApiInternal(token, API_AUTH_TYPE.TOKEN);
5510
- api.setEnv(this.env, this.alias);
5511
- switch (tokenData.service_type) {
5512
- case STANDALONE_3DS_GATEWAYS.GPAYMENTS:
5513
- new GPaymentsService(this.container, api, this.eventEmitter).load(tokenData, options.title);
5514
- break;
5515
- }
5552
+ key: "getParams",
5553
+ value: function getParams() {
5554
+ return this.params;
5516
5555
  }
5517
5556
  }, {
5518
5557
  key: "setEnv",
5519
5558
  value: function setEnv(env, alias) {
5520
- this.env = env;
5521
- this.alias = alias;
5559
+ this.env.setEnv(env, alias);
5560
+ }
5561
+ }, {
5562
+ key: "getEnv",
5563
+ value: function getEnv() {
5564
+ return this.env.getEnv();
5565
+ }
5566
+ }, {
5567
+ key: "getBaseUrl",
5568
+ value: function getBaseUrl() {
5569
+ return this.env.getConf().url;
5522
5570
  }
5523
5571
  }]);
5524
5572
  }();
@@ -5558,7 +5606,7 @@ var TOKEN_FORMAT$2;
5558
5606
  * @param {string} CHARGE_AUTH_CHALLENGE=chargeAuthChallenge
5559
5607
  * @param {string} CHARGE_AUTH_INFO=chargeAuthInfo
5560
5608
  * @param {string} ERROR=error
5561
- */
5609
+ */
5562
5610
  /**
5563
5611
  * Class Canvas3ds include method for working on html
5564
5612
  * @constructor
@@ -5594,13 +5642,21 @@ var Canvas3ds = /*#__PURE__*/function () {
5594
5642
  *
5595
5643
  */
5596
5644
  function load() {
5597
- if (this.token.format === TOKEN_FORMAT$2.HTML) this.iFrame.loadFromHtml(this.token.content, {
5598
- title: '3d secure authentication'
5599
- }, 'threeDSecure-iframe');else if (this.token.format === TOKEN_FORMAT$2.URL) this.iFrame.load(this.token.content, {
5600
- title: '3d secure authentication'
5601
- }, 'threeDSecure-iframe');else if (this.token.format === TOKEN_FORMAT$2.STANDALONE_3DS) this.standalone3dsService.load(this.token.content, {
5602
- title: '3d secure authentication'
5603
- });else console.error('Token contain unsupported payload');
5645
+ if (this.token.format === TOKEN_FORMAT$2.HTML) {
5646
+ this.iFrame.loadFromHtml(this.token.content, {
5647
+ title: '3d secure authentication'
5648
+ }, 'threeDSecure-iframe');
5649
+ } else if (this.token.format === TOKEN_FORMAT$2.URL) {
5650
+ this.iFrame.load(this.token.content, {
5651
+ title: '3d secure authentication'
5652
+ }, 'threeDSecure-iframe');
5653
+ } else if (this.token.format === TOKEN_FORMAT$2.STANDALONE_3DS) {
5654
+ this.standalone3dsService.load(this.token.content, {
5655
+ title: '3d secure authentication'
5656
+ });
5657
+ } else {
5658
+ console.error('Token contain unsupported payload');
5659
+ }
5604
5660
  }
5605
5661
  /**
5606
5662
  * Current method can change environment. By default environment = sandbox.
@@ -5617,7 +5673,9 @@ var Canvas3ds = /*#__PURE__*/function () {
5617
5673
  this.link.setEnv(env, alias);
5618
5674
  this.standalone3dsService.setEnv(env, alias);
5619
5675
  for (var index in this.configs) {
5620
- if (!this.configs.hasOwnProperty(index)) continue;
5676
+ if (!Object.hasOwn(this.configs, index)) {
5677
+ continue;
5678
+ }
5621
5679
  this.configs[index].setEnv(env, alias);
5622
5680
  }
5623
5681
  }
@@ -5627,34 +5685,45 @@ var Canvas3ds = /*#__PURE__*/function () {
5627
5685
  return this.link.getEnv();
5628
5686
  }
5629
5687
  /**
5630
- * Listen to events of widget
5688
+ * Listen to events of widget.
5631
5689
  *
5632
- * @example
5690
+ * Available event names are defined in {@link Canvas3dsEventMap} (typed) and
5691
+ * {@link CANVAS_3DS_EVENT} (string constants). Using a literal event name
5692
+ * narrows the callback payload via the typed overloads.
5633
5693
  *
5634
- * widget.on('chargeAuthReject', function (data) {
5635
- * console.log(data);
5694
+ * @example
5695
+ * // Callback form — payload is narrowed by the event name
5696
+ * widget.on('chargeAuthReject', (data) => {
5697
+ * console.log(data); // data is Canvas3dsAuthPayload | Canvas3dsChargeAuthEventPayload
5636
5698
  * });
5637
- * // or
5638
- * widget.on('chargeAuthReject').then(function (data) {
5639
- * console.log(data);
5699
+ *
5700
+ * // Promise form
5701
+ * widget.on('chargeAuthReject').then((data) => {
5702
+ * console.log(data);
5640
5703
  * });
5641
- * @param {string} eventName - Available event names [EVENT]{@link EVENT} [STANDALONE_3DS_EVENT]{@link STANDALONE_3DS_EVENT}
5642
- * @param {listener} [cb]
5643
- * @return {Promise<IEventData> | void}
5704
+ *
5705
+ * @param eventName - Event name from {@link Canvas3dsEventMap} or any string for dynamic events.
5706
+ * @param cb - Optional listener callback. If omitted, returns a Promise that resolves on the next emission.
5707
+ * @returns `void` when a callback is provided; otherwise a Promise that resolves with the event payload.
5644
5708
  */
5709
+ // biome-ignore lint/suspicious/noExplicitAny: implementation signature must accept any payload shape to satisfy all overloads above
5645
5710
  }, {
5646
5711
  key: "on",
5647
5712
  value: function on(eventName, cb) {
5648
5713
  var _this = this;
5649
5714
  if (this.token.format === TOKEN_FORMAT$2.STANDALONE_3DS) {
5650
- if (typeof cb === 'function') return this.eventEmitter.subscribe(eventName, cb);
5715
+ if (typeof cb === 'function') {
5716
+ return this.eventEmitter.subscribe(eventName, cb);
5717
+ }
5651
5718
  return new Promise(function (resolve) {
5652
5719
  return _this.eventEmitter.subscribe(eventName, function (res) {
5653
5720
  return resolve(res);
5654
5721
  });
5655
5722
  });
5656
5723
  } else {
5657
- if (typeof cb === 'function') return this.event.on(eventName, this.link.getParams().ref_id, cb);
5724
+ if (typeof cb === 'function') {
5725
+ return this.event.on(eventName, this.link.getParams().ref_id, cb);
5726
+ }
5658
5727
  return new Promise(function (resolve) {
5659
5728
  return _this.event.on(eventName, _this.link.getParams().ref_id, function (res) {
5660
5729
  return resolve(res);
@@ -5698,6 +5767,19 @@ var Canvas3ds = /*#__PURE__*/function () {
5698
5767
  }]);
5699
5768
  }();
5700
5769
 
5770
+ /**
5771
+ * Public, tree-shakeable alias for the internal `TOKEN_FORMAT` enum in canvas-3ds.ts.
5772
+ * Mirrors the string values of that enum without exposing the private enum itself.
5773
+ */
5774
+ var Canvas3dsTokenFormat = {
5775
+ /** Token whose `content` is a complete HTML page. The SDK renders it inside an iframe. */
5776
+ HTML: 'html',
5777
+ /** Token whose `content` is a URL. The SDK loads it inside an iframe. */
5778
+ URL: 'url',
5779
+ /** Token whose `content` describes a standalone 3DS service (e.g. GPayments). The SDK delegates to that service's flow. */
5780
+ STANDALONE_3DS: 'standalone_3ds'
5781
+ };
5782
+
5701
5783
  var Spinner = /*#__PURE__*/function () {
5702
5784
  function Spinner() {
5703
5785
  _classCallCheck(this, Spinner);
@@ -12783,28 +12865,59 @@ function getHandleCvv(configuration) {
12783
12865
  }
12784
12866
  }
12785
12867
 
12868
+ /**
12869
+ * Top-level classification of an error. Used by the SDK to route errors to the
12870
+ * right category in instrumentation and to give consumers a coarse-grained
12871
+ * tag for grouping/filtering. See {@link getErrorCategory} for the mapping
12872
+ * between {@link ERROR_CAUSE} and {@link ERROR_CATEGORY}.
12873
+ */
12786
12874
  var ERROR_CATEGORY = {
12875
+ /** SDK was misconfigured (missing keys, invalid options, etc.). */
12787
12876
  CONFIGURATION: 'configuration',
12877
+ /** Authentication or authorization failure. */
12788
12878
  IDENTITY: 'identity_access_management',
12879
+ /** SDK internal failure or upstream service problem. */
12789
12880
  INTERNAL: 'internal',
12881
+ /** Flow lifecycle event (user cancelled, aborted, etc.) — not a real fault. */
12790
12882
  PROCESS: 'process',
12883
+ /** Resource lookup failed or was rate-limited. */
12791
12884
  RESOURCE: 'resource',
12885
+ /** Invalid input or business-rule validation failure. */
12792
12886
  VALIDATION: 'validation'
12793
12887
  };
12888
+ /**
12889
+ * Concrete cause of an error. More specific than {@link ERROR_CATEGORY} —
12890
+ * useful for deciding programmatic responses (e.g. show a retry button only
12891
+ * when `cause` is `'service_unreachable'` or `'server_busy'`).
12892
+ */
12794
12893
  var ERROR_CAUSE = {
12894
+ /** Operation was aborted programmatically. */
12795
12895
  ABORTED: 'aborted',
12896
+ /** Caller has insufficient permissions for the operation. */
12796
12897
  ACCESS_FORBIDDEN: 'access_forbidden',
12898
+ /** Resource already exists when create was expected. */
12797
12899
  ALREADY_EXISTS: 'already_exists',
12900
+ /** User cancelled the flow (e.g. closed the wallet sheet). */
12798
12901
  CANCELED: 'canceled',
12902
+ /** SDK was instantiated or invoked with invalid configuration. */
12799
12903
  INVALID_CONFIGURATION: 'invalid_configuration',
12904
+ /** Input failed structural or business-rule validation. */
12800
12905
  INVALID_INPUT: 'invalid_input',
12906
+ /** Resource was not found by the backend. */
12801
12907
  NOT_FOUND: 'not_found',
12908
+ /** Operation is not supported in the current context or version. */
12802
12909
  NOT_IMPLEMENTED: 'not_implemented',
12910
+ /** Caller exceeded the allowed request rate. */
12803
12911
  RATE_LIMITED: 'rate_limited',
12912
+ /** Backend is healthy but currently overloaded — typically retryable. */
12804
12913
  SERVER_BUSY: 'server_busy',
12914
+ /** Backend or third-party service could not be reached — typically retryable. */
12805
12915
  SERVICE_UNREACHABLE: 'service_unreachable',
12916
+ /** Caller is not authenticated. */
12806
12917
  UNAUTHORIZED: 'unauthorized',
12918
+ /** Catch-all when no other cause applies. */
12807
12919
  UNKNOWN: 'unknown_error',
12920
+ /** Request was syntactically valid but semantically rejected. */
12808
12921
  UNPROCESSABLE_ENTITY: 'unprocessable_entity'
12809
12922
  };
12810
12923
  var EventError = /*#__PURE__*/function (_Error) {
@@ -14864,7 +14977,6 @@ var InstructionCanvas3dsShow$1 = /*#__PURE__*/function (_InstructionHandler) {
14864
14977
  });
14865
14978
  canvas.on('chargeAuthReject', function () {
14866
14979
  var _a;
14867
- // **TODO add interface for chargeAuthReject event **//
14868
14980
  (_a = _this.checkoutWidget) === null || _a === void 0 ? void 0 : _a.fetchInstruction();
14869
14981
  _this.api.checkout().callback({
14870
14982
  event: 'callback.child_widget.status',
@@ -14881,13 +14993,13 @@ var InstructionCanvas3dsShow$1 = /*#__PURE__*/function (_InstructionHandler) {
14881
14993
  });
14882
14994
  canvas.on('error', function (event) {
14883
14995
  var _a;
14884
- // **TODO add interface for error event **//
14885
14996
  (_a = _this.checkoutWidget) === null || _a === void 0 ? void 0 : _a.fetchInstruction();
14997
+ var message = (event && _typeof$1(event) === 'object' && 'event' in event ? event.event : null) || 'error in 3ds widget';
14886
14998
  _this.api.checkout().callback({
14887
14999
  event: 'callback.child_widget.status',
14888
15000
  payload: {
14889
15001
  status: 'error',
14890
- message: (event === null || event === void 0 ? void 0 : event.event) || 'error in 3ds widget'
15002
+ message: message
14891
15003
  }
14892
15004
  }).then(function () {
14893
15005
  return console.info('callback.child_widget.status: - errorEvent');
@@ -17255,7 +17367,6 @@ var InstructionCanvas3dsShow = /*#__PURE__*/function (_InstructionHandler) {
17255
17367
  });
17256
17368
  canvas.on('chargeAuthReject', function () {
17257
17369
  var _a;
17258
- // **TODO add interface for chargeAuthReject event **//
17259
17370
  (_a = _this.checkoutWidget) === null || _a === void 0 ? void 0 : _a.fetchInstruction();
17260
17371
  _this.api.checkout().callback({
17261
17372
  event: 'callback.child_widget.status',
@@ -17272,13 +17383,13 @@ var InstructionCanvas3dsShow = /*#__PURE__*/function (_InstructionHandler) {
17272
17383
  });
17273
17384
  canvas.on('error', function (event) {
17274
17385
  var _a;
17275
- // **TODO add interface for error event **//
17276
17386
  (_a = _this.checkoutWidget) === null || _a === void 0 ? void 0 : _a.fetchInstruction();
17387
+ var message = (event && _typeof$1(event) === 'object' && 'event' in event ? event.event : null) || 'error in 3ds widget';
17277
17388
  _this.api.checkout().callback({
17278
17389
  event: 'callback.child_widget.status',
17279
17390
  payload: {
17280
17391
  status: 'error',
17281
- message: (event === null || event === void 0 ? void 0 : event.event) || 'error in 3ds widget'
17392
+ message: message
17282
17393
  }
17283
17394
  }).then(function () {
17284
17395
  return console.info('callback.child_widget.status: - errorEvent');
@@ -18645,10 +18756,16 @@ function getCheckoutVersionHandler(version) {
18645
18756
  }
18646
18757
  }
18647
18758
 
18759
+ /** Event name emitted when a checkout payment completes successfully. */
18760
+ var PAYMENT_SUCCESSFUL = 'paymentSuccessful';
18761
+ /** Event name emitted when a checkout payment fails. */
18762
+ var PAYMENT_FAILURE = 'paymentFailure';
18763
+ /** Event name emitted when a checkout session expires. */
18764
+ var PAYMENT_EXPIRED = 'paymentExpired';
18648
18765
  var EVENT$3 = {
18649
- PAYMENT_SUCCESSFUL: 'paymentSuccessful',
18650
- PAYMENT_FAILURE: 'paymentFailure',
18651
- PAYMENT_EXPIRED: 'paymentExpired'
18766
+ PAYMENT_SUCCESSFUL: PAYMENT_SUCCESSFUL,
18767
+ PAYMENT_FAILURE: PAYMENT_FAILURE,
18768
+ PAYMENT_EXPIRED: PAYMENT_EXPIRED
18652
18769
  };
18653
18770
  /**
18654
18771
  * Class CheckoutButton transform usual button into checkout
@@ -18673,7 +18790,7 @@ var Checkout = /*#__PURE__*/function () {
18673
18790
  this.checkoutFinished = false;
18674
18791
  try {
18675
18792
  this.eventEmitter = new EventEmitter();
18676
- this.intentTokenPayload = this.extractIntentTokenPayload(intentToken);
18793
+ this.intentTokenPayload = this.extractCheckoutIntentTokenPayload(intentToken);
18677
18794
  this.checkoutVersionHandler = getCheckoutVersionHandler(this.intentTokenPayload.version);
18678
18795
  this.instructions = this.initContractVersion();
18679
18796
  this.api = new ApiInternal(this.intentToken, API_AUTH_TYPE.TOKEN);
@@ -18734,8 +18851,8 @@ var Checkout = /*#__PURE__*/function () {
18734
18851
  }, 14 * 60 * 1000 + 45 * 1000);
18735
18852
  }
18736
18853
  }, {
18737
- key: "extractIntentTokenPayload",
18738
- value: function extractIntentTokenPayload(intentToken) {
18854
+ key: "extractCheckoutIntentTokenPayload",
18855
+ value: function extractCheckoutIntentTokenPayload(intentToken) {
18739
18856
  var tokenContent = AccessToken.validateJWT(intentToken);
18740
18857
  if (!tokenContent) {
18741
18858
  throw new Error('Intent token is broken or expired. Please, issue new one.');
@@ -18763,7 +18880,7 @@ var Checkout = /*#__PURE__*/function () {
18763
18880
  value: function ready() {
18764
18881
  var _this3 = this;
18765
18882
  this.changeLoadingSpinnerVisibility(true);
18766
- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
18883
+ // biome-ignore lint/suspicious/noExplicitAny: checkoutApi.status returns a dynamic shape whose fields are narrowed at the call-sites below
18767
18884
  this.checkoutApi.status(this.intentTokenPayload.intent_id).then(function (response) {
18768
18885
  if (!(response === null || response === void 0 ? void 0 : response.status)) {
18769
18886
  throw new Error('Checkout Intent Status structure inconsistent');
@@ -18872,8 +18989,8 @@ var Checkout = /*#__PURE__*/function () {
18872
18989
  * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
18873
18990
  *
18874
18991
  * @example
18875
- * widget.onPaymentInReview((data) => {
18876
- * console.log('Payment in fraud review');
18992
+ * widget.onPaymentExpired((data) => {
18993
+ * console.log('Payment session expired');
18877
18994
  * });
18878
18995
  */
18879
18996
  }, {
@@ -18994,6 +19111,7 @@ var OpenWalletButtons = /*#__PURE__*/function () {
18994
19111
  function OpenWalletButtons(selector, publicKeyOrAccessToken, serviceId, meta) {
18995
19112
  _classCallCheck(this, OpenWalletButtons);
18996
19113
  this.env = DEFAULT_ENV;
19114
+ this.isDisabled = false;
18997
19115
  this.onShippingOptionsChangeHandlerRegistered = false;
18998
19116
  // Runtime guard: TypeScript's `abstract` keyword exists only at compile time.
18999
19117
  // Without this check, instantiating the base class directly silently fails
@@ -19138,6 +19256,68 @@ var OpenWalletButtons = /*#__PURE__*/function () {
19138
19256
  _this.handleOnError(error instanceof Error ? error : new Error(String(error)), ERROR_OPERATION.CONFIGURATION);
19139
19257
  });
19140
19258
  }
19259
+ /**
19260
+ * Enables the wallet button, restoring interactivity and visual appearance.
19261
+ * If the button was previously disabled via `disable()`, calling this method
19262
+ * re-enables clicks and removes the disabled visual state.
19263
+ *
19264
+ * Idempotent — calling on an already-enabled button has no effect.
19265
+ *
19266
+ * @example
19267
+ * button.enable();
19268
+ */
19269
+ }, {
19270
+ key: "enable",
19271
+ value: function enable() {
19272
+ this.isDisabled = false;
19273
+ this.applyDisabledStyles();
19274
+ }
19275
+ /**
19276
+ * Disables the wallet button, preventing clicks and applying a visual disabled state.
19277
+ * When disabled, the button appears grayed out (`opacity: 0.5`) and does not
19278
+ * respond to user interaction (`pointer-events: none`). For accessibility, the
19279
+ * `aria-disabled="true"` attribute is also set on the container.
19280
+ *
19281
+ * Programmatic clicks (e.g. invoked by the wallet provider's SDK) are blocked
19282
+ * by an explicit guard inside the click handler — the button's wallet service
19283
+ * checks the disabled state before processing.
19284
+ *
19285
+ * Idempotent — calling on an already-disabled button has no effect.
19286
+ * Safe to call before `load()` (no-throw); the styles are applied once the
19287
+ * container element exists.
19288
+ *
19289
+ * @example
19290
+ * button.disable();
19291
+ */
19292
+ }, {
19293
+ key: "disable",
19294
+ value: function disable() {
19295
+ this.isDisabled = true;
19296
+ this.applyDisabledStyles();
19297
+ }
19298
+ /**
19299
+ * Applies the disabled / enabled visual state to the container element.
19300
+ * Reads `this.isDisabled` and toggles the corresponding CSS + ARIA attributes.
19301
+ *
19302
+ * @private
19303
+ */
19304
+ }, {
19305
+ key: "applyDisabledStyles",
19306
+ value: function applyDisabledStyles() {
19307
+ var element = this.container.getElement();
19308
+ if (!element) {
19309
+ return;
19310
+ }
19311
+ if (this.isDisabled) {
19312
+ element.style.pointerEvents = 'none';
19313
+ element.style.opacity = '0.5';
19314
+ element.setAttribute('aria-disabled', 'true');
19315
+ } else {
19316
+ element.style.pointerEvents = '';
19317
+ element.style.opacity = '';
19318
+ element.removeAttribute('aria-disabled');
19319
+ }
19320
+ }
19141
19321
  /**
19142
19322
  * Current method can change environment. By default environment = sandbox.
19143
19323
  * Also we can change domain alias for this environment. By default domain_alias = paydock.com
@@ -19627,7 +19807,9 @@ var SERVICE_GROUP;
19627
19807
  * Returns `undefined` if the resulting object has no remaining properties.
19628
19808
  */
19629
19809
  function stripEmpty(obj) {
19630
- if (!obj || _typeof$1(obj) !== 'object') return undefined;
19810
+ if (!obj || _typeof$1(obj) !== 'object') {
19811
+ return undefined;
19812
+ }
19631
19813
  var result = {};
19632
19814
  for (var _i = 0, _Object$entries = Object.entries(obj); _i < _Object$entries.length; _i++) {
19633
19815
  var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
@@ -19676,13 +19858,30 @@ var OpenWalletService = /*#__PURE__*/function () {
19676
19858
  this.serviceGroup = SERVICE_GROUP.WALLET;
19677
19859
  }
19678
19860
  /**
19679
- * Creates a One-Time Token (OTT) by sending the payment data to the API.
19680
- * Emits {@link EVENT.SUCCESS} on success or {@link EVENT.ERROR} on failure.
19861
+ * Returns whether the wallet button is currently disabled.
19862
+ * Reads the `aria-disabled` attribute from the container element — set by the
19863
+ * button class via {@link OpenWalletButtons.disable} / {@link OpenWalletButtons.enable}.
19681
19864
  *
19682
- * @param data - The payment data including amount, shipping, billing, card info, and ref token.
19683
- * @returns A promise resolving to the OTT response.
19865
+ * Used to short-circuit click handlers in concrete wallet services for clicks
19866
+ * that bypass the DOM `pointer-events: none` guard (e.g. invoked by the wallet
19867
+ * provider's SDK callback).
19868
+ *
19869
+ * @returns `true` if the container is marked as disabled, `false` otherwise.
19684
19870
  */
19685
19871
  return _createClass(OpenWalletService, [{
19872
+ key: "isButtonDisabled",
19873
+ value: function isButtonDisabled() {
19874
+ var element = this.container.getElement();
19875
+ return (element === null || element === void 0 ? void 0 : element.getAttribute('aria-disabled')) === 'true';
19876
+ }
19877
+ /**
19878
+ * Creates a One-Time Token (OTT) by sending the payment data to the API.
19879
+ * Emits {@link EVENT.SUCCESS} on success or {@link EVENT.ERROR} on failure.
19880
+ *
19881
+ * @param data - The payment data including amount, shipping, billing, card info, and ref token.
19882
+ * @returns A promise resolving to the OTT response.
19883
+ */
19884
+ }, {
19686
19885
  key: "createOTT",
19687
19886
  value: function createOTT(data) {
19688
19887
  var _this = this;
@@ -20203,6 +20402,9 @@ var ApplePayOpenWalletService = /*#__PURE__*/function (_OpenWalletService) {
20203
20402
  key: "onApplePayButtonClicked",
20204
20403
  value: function onApplePayButtonClicked() {
20205
20404
  var _this7 = this;
20405
+ if (this.isButtonDisabled()) {
20406
+ return;
20407
+ }
20206
20408
  var applePayApiVersion = getSupportedApplePayVersion();
20207
20409
  if (applePayApiVersion === 0) {
20208
20410
  this.handleOnUnavailable('Apple Pay version not supported');
@@ -20953,6 +21155,9 @@ var GooglePayOpenWalletService = /*#__PURE__*/function (_OpenWalletService) {
20953
21155
  key: "onGooglePayButtonClicked",
20954
21156
  value: function onGooglePayButtonClicked() {
20955
21157
  var _this5 = this;
21158
+ if (this.isButtonDisabled()) {
21159
+ return;
21160
+ }
20956
21161
  if (this.processingButtonClick) {
20957
21162
  console.warn('Google Pay button clicked while processing.');
20958
21163
  return;
@@ -44474,4 +44679,4 @@ var browser = /*#__PURE__*/Object.freeze({
44474
44679
  zlibSync: zlibSync
44475
44680
  });
44476
44681
 
44477
- export { AfterpayCheckoutButton, AfterpayOnSiteMessaging, Api, ApplePayOpenWalletButton, ApplePayWalletButtonExpress, CHECKOUT_BUTTON_EVENT, Canvas3ds, Checkout, ClickToPay, Configuration, ContactShippingEditingMode, ELEMENT, ERROR_OPERATION, EVENT$5 as EVENT, Builder$1 as ExternalCheckoutBuilder, Checker as ExternalCheckoutChecker, FORM_FIELD$1 as FORM_FIELD, FRAUD_PREVENTION_EVENTS, FraudPreventionService, GooglePayOpenWalletButton, HtmlMultiWidget, HtmlPaymentSourceWidget, HtmlWidget, InstructionDebugger, MultiWidget, PAYMENT_TYPE, PURPOSE, PayPalDataCollector, PayPalSavePaymentSourceWidget, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, PaypalWalletButtonExpress, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE$2 as STYLE, SUPPORTED_CARD_TYPES, TEXT, TOKEN_TYPE, TRIGGER$1 as TRIGGER, TYPE, VAULT_DISPLAY_STYLE, VaultDisplayWidget, EVENT as WALLET_BUTTONS_EXPRESS_EVENT, WALLET_TYPES, WalletButtons, ZipmoneyCheckoutButton };
44682
+ export { AfterpayCheckoutButton, AfterpayOnSiteMessaging, Api, ApplePayOpenWalletButton, ApplePayWalletButtonExpress, CANVAS_3DS_EVENT, CHECKOUT_BUTTON_EVENT, EVENT$3 as CHECKOUT_EVENT, Canvas3ds, Canvas3dsTokenFormat, Checkout, ClickToPay, Configuration, ContactShippingEditingMode, ELEMENT, ERROR_OPERATION, EVENT$5 as EVENT, Builder$1 as ExternalCheckoutBuilder, Checker as ExternalCheckoutChecker, FORM_FIELD$1 as FORM_FIELD, FRAUD_PREVENTION_EVENTS, FraudPreventionService, GooglePayOpenWalletButton, HtmlMultiWidget, HtmlPaymentSourceWidget, HtmlWidget, InstructionDebugger, MultiWidget, PAYMENT_EXPIRED, PAYMENT_FAILURE, PAYMENT_SUCCESSFUL, PAYMENT_TYPE, PURPOSE, PayPalDataCollector, PayPalSavePaymentSourceWidget, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, PaypalWalletButtonExpress, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE$2 as STYLE, SUPPORTED_CARD_TYPES, TEXT, TOKEN_TYPE, TRIGGER$1 as TRIGGER, TYPE, VAULT_DISPLAY_STYLE, VaultDisplayWidget, EVENT as WALLET_BUTTONS_EXPRESS_EVENT, WALLET_TYPES, WalletButtons, ZipmoneyCheckoutButton };