@paydock/client-sdk 1.127.1-beta → 1.128.2

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 (64) hide show
  1. package/README.md +1016 -3980
  2. package/bundles/index.cjs +100 -54
  3. package/bundles/index.cjs.d.ts +13 -2
  4. package/bundles/index.mjs +100 -54
  5. package/bundles/index.mjs.d.ts +13 -2
  6. package/bundles/types/checkout/layout-widgets/additionals.d.ts.map +1 -1
  7. package/bundles/types/checkout/layout-widgets/payment-template.d.ts.map +1 -1
  8. package/bundles/types/components/param.d.ts +2 -0
  9. package/bundles/types/components/param.d.ts.map +1 -1
  10. package/bundles/types/index-cba.d.ts +11 -11
  11. package/bundles/types/index-cba.d.ts.map +1 -1
  12. package/bundles/types/index.d.ts +11 -11
  13. package/bundles/types/index.d.ts.map +1 -1
  14. package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts +2 -1
  15. package/bundles/types/secure-remote-commerce/click-to-pay-secure-remote-commerce.d.ts.map +1 -1
  16. package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts +6 -4
  17. package/bundles/types/secure-remote-commerce/providers/mastercard-src/mastercard-src.d.ts.map +1 -1
  18. package/bundles/types/wallet-buttons/index.d.ts +6 -6
  19. package/bundles/types/wallet-buttons/wallet-buttons.d.ts +2 -2
  20. package/bundles/types/wallet-buttons-express/enum/event.enum.d.ts.map +1 -1
  21. package/bundles/types/wallet-buttons-express/index.d.ts +3 -3
  22. package/bundles/types/wallet-buttons-express/index.d.ts.map +1 -1
  23. package/bundles/types/wallet-buttons-express/interfaces/charge-wallet-token-meta.interface.d.ts.map +1 -1
  24. package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts +2 -2
  25. package/bundles/types/wallet-buttons-express/interfaces/on-click-event-data.interface.d.ts.map +1 -1
  26. package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts +2 -2
  27. package/bundles/types/wallet-buttons-express/interfaces/on-close-event-data.interface.d.ts.map +1 -1
  28. package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts +2 -2
  29. package/bundles/types/wallet-buttons-express/interfaces/on-error-event-data.interface.d.ts.map +1 -1
  30. package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts +2 -2
  31. package/bundles/types/wallet-buttons-express/interfaces/on-payment-error-event-data.interface.d.ts.map +1 -1
  32. package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts +2 -2
  33. package/bundles/types/wallet-buttons-express/interfaces/on-payment-in-review-event-data.interface.d.ts.map +1 -1
  34. package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts +2 -2
  35. package/bundles/types/wallet-buttons-express/interfaces/on-payment-successful-event-data.interface.d.ts.map +1 -1
  36. package/bundles/types/wallet-buttons-express/interfaces/on-shipping-address-change-event-data.interface.d.ts.map +1 -1
  37. package/bundles/types/wallet-buttons-express/interfaces/on-shipping-address-change-event-response.interface.d.ts.map +1 -1
  38. package/bundles/types/wallet-buttons-express/interfaces/on-shipping-option-change-event-data.interface.d.ts.map +1 -1
  39. package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts +2 -2
  40. package/bundles/types/wallet-buttons-express/interfaces/on-unavailable-event-data.interface.d.ts.map +1 -1
  41. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts +5 -5
  42. package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -1
  43. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-shipping-data.d.ts.map +1 -1
  44. package/bundles/types/wallet-buttons-express/services/apple-pay/types/apple-pay-shipping-method.type.d.ts.map +1 -1
  45. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +1 -1
  46. package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -1
  47. package/bundles/types/wallet-buttons-express/types/shipping-event-to-response.type.d.ts +4 -4
  48. package/bundles/types/wallet-buttons-express/types/shipping-event-to-response.type.d.ts.map +1 -1
  49. package/bundles/types/widget/multi-widget.d.ts +8 -0
  50. package/bundles/types/widget/multi-widget.d.ts.map +1 -1
  51. package/bundles/widget.umd.js +100 -54
  52. package/bundles/widget.umd.js.d.ts +13 -2
  53. package/bundles/widget.umd.js.min.d.ts +13 -2
  54. package/bundles/widget.umd.min.js +1 -1
  55. package/docs/api-checkout-button.md +0 -370
  56. package/docs/api-widget.md +0 -2110
  57. package/docs/checkout-examples.md +2 -127
  58. package/docs/license.md +1 -1
  59. package/docs/wallet-buttons-examples.md +3 -134
  60. package/docs/wallet-buttons.md +10 -10
  61. package/docs/wallet-cba-buttons-examples.md +1 -1
  62. package/package.json +1 -1
  63. package/slate.md +5 -524
  64. package/docs/api-vault-display.md +0 -94
package/bundles/index.cjs CHANGED
@@ -954,7 +954,7 @@ SDK.headerKeys = Object.freeze({
954
954
  version: 'x-sdk-version',
955
955
  type: 'x-sdk-type'
956
956
  });
957
- SDK._version = 'v1.127.1-beta';
957
+ SDK._version = 'v1.128.2';
958
958
 
959
959
  /******************************************************************************
960
960
  Copyright (c) Microsoft Corporation.
@@ -5757,7 +5757,8 @@ var FORM_FIELD$1 = {
5757
5757
  ADDRESS_COUNTRY: 'address_country',
5758
5758
  ADDRESS_CITY: 'address_city',
5759
5759
  ADDRESS_POSTCODE: 'address_postcode',
5760
- ADDRESS_COMPANY: 'address_company'
5760
+ ADDRESS_COMPANY: 'address_company',
5761
+ SAVE_CARD_CONSENT_ACCEPTED: 'save_card_consent_accepted'
5761
5762
  };
5762
5763
  var STYLE$2 = {
5763
5764
  BACKGROUND_COLOR: 'background_color',
@@ -8658,51 +8659,6 @@ var HtmlPaymentSourceWidget = /*#__PURE__*/function (_PaymentSourceWidget) {
8658
8659
  }]);
8659
8660
  }(PaymentSourceWidget);
8660
8661
 
8661
- /**
8662
- * List of available event's name in the Click To Pay checkout lifecycle
8663
- * @enum EVENT
8664
- *
8665
- * @type {object}
8666
- * @param {string} IFRAME_LOADED=iframeLoaded Initial event sent when IFrame is initially loaded.
8667
- * @param {string} CHECKOUT_READY=checkoutReady Event sent when checkout is loaded and ready to be used by customer. Leverage alongside [showCheckout](#SRC+showCheckout) and [hideCheckout](#SRC+hideCheckout).
8668
- * @param {string} CHECKOUT_POPUP_OPEN=checkoutPopupOpen Event sent when Click To Pay checkout flow is started, regardless of embedded or windowed mode.
8669
- * @param {string} CHECKOUT_POPUP_CLOSE=checkoutPopupClose Event sent when Click To Pay checkout flow is closed, regardless of embedded or windowed mode.
8670
- * @param {string} CHECKOUT_COMPLETED=checkoutCompleted Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information.
8671
- * @param {string} CHECKOUT_ERROR=checkoutError Event sent on error checkout by customer. Check [data](#EventData) for more information.
8672
- */
8673
- var EVENT$3;
8674
- (function (EVENT) {
8675
- EVENT["IFRAME_LOADED"] = "iframeLoaded";
8676
- EVENT["CHECKOUT_READY"] = "checkoutReady";
8677
- EVENT["CHECKOUT_COMPLETED"] = "checkoutCompleted";
8678
- EVENT["CHECKOUT_ERROR"] = "checkoutError";
8679
- EVENT["CHECKOUT_POPUP_OPEN"] = "checkoutPopupOpen";
8680
- EVENT["CHECKOUT_POPUP_CLOSE"] = "checkoutPopupClose";
8681
- })(EVENT$3 || (EVENT$3 = {}));
8682
- /**
8683
- * List of available event data types
8684
- * @enum EVENT_DATA_TYPE
8685
- *
8686
- * @type {object}
8687
- * @param {string} CRITICAL_ERROR=CriticalError in this error scenario the checkout is understood to be in a non-recoverable state and should be closed by the merchant and give alternate payment options to the user
8688
- * @param {string} USER_ERROR=UserError in this error scenario the error in likely a user input error and the checkout is in a recoverable state, so the user will be kept within the checkout and can retry the flow
8689
- * @param {string} SUCCESS=Success
8690
- */
8691
- var EVENT_DATA_TYPE;
8692
- (function (EVENT_DATA_TYPE) {
8693
- EVENT_DATA_TYPE["CRITICAL_ERROR"] = "CriticalError";
8694
- EVENT_DATA_TYPE["USER_ERROR"] = "UserError";
8695
- EVENT_DATA_TYPE["SUCCESS"] = "Success";
8696
- })(EVENT_DATA_TYPE || (EVENT_DATA_TYPE = {}));
8697
- var STYLE = {
8698
- PRIMARY_BUTTON_COLOR: 'primary_button_color',
8699
- SECONDARY_BUTTON_COLOR: 'secondary_button_color',
8700
- PRIMARY_BUTTON_TEXT_COLOR: 'primary_button_text_color',
8701
- SECONDARY_BUTTON_TEXT_COLOR: 'secondary_button_text_color',
8702
- FONT_FAMILY: 'font_family',
8703
- ENABLE_SRC_POPUP: 'enable_src_popup'
8704
- };
8705
-
8706
8662
  /**
8707
8663
  * Interface for classes that represent a trigger data.
8708
8664
  * @interface ITriggerData
@@ -8756,6 +8712,51 @@ var Trigger = /*#__PURE__*/function () {
8756
8712
  }]);
8757
8713
  }();
8758
8714
 
8715
+ /**
8716
+ * List of available event's name in the Click To Pay checkout lifecycle
8717
+ * @enum EVENT
8718
+ *
8719
+ * @type {object}
8720
+ * @param {string} IFRAME_LOADED=iframeLoaded Initial event sent when IFrame is initially loaded.
8721
+ * @param {string} CHECKOUT_READY=checkoutReady Event sent when checkout is loaded and ready to be used by customer. Leverage alongside [showCheckout](#SRC+showCheckout) and [hideCheckout](#SRC+hideCheckout).
8722
+ * @param {string} CHECKOUT_POPUP_OPEN=checkoutPopupOpen Event sent when Click To Pay checkout flow is started, regardless of embedded or windowed mode.
8723
+ * @param {string} CHECKOUT_POPUP_CLOSE=checkoutPopupClose Event sent when Click To Pay checkout flow is closed, regardless of embedded or windowed mode.
8724
+ * @param {string} CHECKOUT_COMPLETED=checkoutCompleted Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information.
8725
+ * @param {string} CHECKOUT_ERROR=checkoutError Event sent on error checkout by customer. Check [data](#EventData) for more information.
8726
+ */
8727
+ var EVENT$3;
8728
+ (function (EVENT) {
8729
+ EVENT["IFRAME_LOADED"] = "iframeLoaded";
8730
+ EVENT["CHECKOUT_READY"] = "checkoutReady";
8731
+ EVENT["CHECKOUT_COMPLETED"] = "checkoutCompleted";
8732
+ EVENT["CHECKOUT_ERROR"] = "checkoutError";
8733
+ EVENT["CHECKOUT_POPUP_OPEN"] = "checkoutPopupOpen";
8734
+ EVENT["CHECKOUT_POPUP_CLOSE"] = "checkoutPopupClose";
8735
+ })(EVENT$3 || (EVENT$3 = {}));
8736
+ /**
8737
+ * List of available event data types
8738
+ * @enum EVENT_DATA_TYPE
8739
+ *
8740
+ * @type {object}
8741
+ * @param {string} CRITICAL_ERROR=CriticalError in this error scenario the checkout is understood to be in a non-recoverable state and should be closed by the merchant and give alternate payment options to the user
8742
+ * @param {string} USER_ERROR=UserError in this error scenario the error in likely a user input error and the checkout is in a recoverable state, so the user will be kept within the checkout and can retry the flow
8743
+ * @param {string} SUCCESS=Success
8744
+ */
8745
+ var EVENT_DATA_TYPE;
8746
+ (function (EVENT_DATA_TYPE) {
8747
+ EVENT_DATA_TYPE["CRITICAL_ERROR"] = "CriticalError";
8748
+ EVENT_DATA_TYPE["USER_ERROR"] = "UserError";
8749
+ EVENT_DATA_TYPE["SUCCESS"] = "Success";
8750
+ })(EVENT_DATA_TYPE || (EVENT_DATA_TYPE = {}));
8751
+ var STYLE = {
8752
+ PRIMARY_BUTTON_COLOR: 'primary_button_color',
8753
+ SECONDARY_BUTTON_COLOR: 'secondary_button_color',
8754
+ PRIMARY_BUTTON_TEXT_COLOR: 'primary_button_text_color',
8755
+ SECONDARY_BUTTON_TEXT_COLOR: 'secondary_button_text_color',
8756
+ FONT_FAMILY: 'font_family',
8757
+ ENABLE_SRC_POPUP: 'enable_src_popup'
8758
+ };
8759
+
8759
8760
  var PerformanceService = /*#__PURE__*/function () {
8760
8761
  function PerformanceService() {
8761
8762
  _classCallCheck(this, PerformanceService);
@@ -8861,9 +8862,20 @@ var PerformanceService = /*#__PURE__*/function () {
8861
8862
  var ClickToPaySRC = /*#__PURE__*/function () {
8862
8863
  function ClickToPaySRC(iframe_selector, service_id, public_key, meta, eventEmitter, autoResize, env, alias) {
8863
8864
  _classCallCheck(this, ClickToPaySRC);
8865
+ var _a, _b, _c;
8864
8866
  this.meta = meta;
8865
8867
  this.eventEmitter = eventEmitter;
8866
8868
  this.autoResize = autoResize;
8869
+ this.isIframeLoaded = false;
8870
+ this.injectedCustomerData = null;
8871
+ if (meta.dpa_config) {
8872
+ var hasAllRawDpaConfig = !!(((_a = this.meta.dpa_config) === null || _a === void 0 ? void 0 : _a.dpa_id) && ((_b = this.meta.dpa_config) === null || _b === void 0 ? void 0 : _b.dpa_name) && ((_c = this.meta.dpa_config) === null || _c === void 0 ? void 0 : _c.dpa_supported_card_schemes));
8873
+ // if doesnt have all fields remove dpa_config from meta
8874
+ if (!hasAllRawDpaConfig) {
8875
+ console.warn('DPA config is missing some required fields, removing it from meta');
8876
+ delete meta.dpa_config;
8877
+ }
8878
+ }
8867
8879
  this.link = new Link(MASTERCARD_SRC);
8868
8880
  this.link.setParams(_extends({
8869
8881
  service_id: service_id,
@@ -8926,7 +8938,12 @@ var ClickToPaySRC = /*#__PURE__*/function () {
8926
8938
  if (iframeElement) {
8927
8939
  iframeElement.setAttribute('allow', 'payment; accelerometer;');
8928
8940
  iframeElement.onload = function () {
8929
- return _this2.eventEmitter.emit(EVENT$3.IFRAME_LOADED, {});
8941
+ _this2.isIframeLoaded = true;
8942
+ _this2.eventEmitter.emit(EVENT$3.IFRAME_LOADED, {});
8943
+ if (_this2.injectedCustomerData) {
8944
+ _this2.injectCustomerData(_this2.injectedCustomerData);
8945
+ _this2.injectedCustomerData = null;
8946
+ }
8930
8947
  };
8931
8948
  }
8932
8949
  }
@@ -8977,6 +8994,10 @@ var ClickToPaySRC = /*#__PURE__*/function () {
8977
8994
  }, {
8978
8995
  key: "injectCustomerData",
8979
8996
  value: function injectCustomerData(customerData) {
8997
+ if (!this.isIframeLoaded) {
8998
+ this.injectedCustomerData = customerData;
8999
+ return;
9000
+ }
8980
9001
  this.trigger.push(TRIGGER$1.INJECT_CUSTOMER_DATA, {
8981
9002
  customer: customerData
8982
9003
  });
@@ -9170,6 +9191,14 @@ var ClickToPay = /*#__PURE__*/function (_SRC) {
9170
9191
  _this.public_key_or_access_token = public_key_or_access_token;
9171
9192
  _this.meta = meta;
9172
9193
  _this.holdingForCustomerData = false;
9194
+ _this.pendingCustomerData = null;
9195
+ // Dequeue customer data only when the iframe has loaded
9196
+ _this.on('iframeLoaded', function () {
9197
+ if (_this.pendingCustomerData && _this.provider) {
9198
+ _this.provider.injectCustomerData(_this.pendingCustomerData);
9199
+ _this.pendingCustomerData = null;
9200
+ }
9201
+ });
9173
9202
  return _this;
9174
9203
  }
9175
9204
  /**
@@ -9179,7 +9208,9 @@ var ClickToPay = /*#__PURE__*/function (_SRC) {
9179
9208
  return _createClass(ClickToPay, [{
9180
9209
  key: "load",
9181
9210
  value: function load() {
9182
- if (this.provider) return;
9211
+ if (this.provider) {
9212
+ return;
9213
+ }
9183
9214
  this.meta.customizations = this.style;
9184
9215
  this.holdingForCustomerData = !!this.meta.hold_for_customer_data;
9185
9216
  this.provider = new ClickToPaySRC(this.iframe_selector, this.service_id, this.public_key_or_access_token, this.meta, this.eventEmitter, this.autoResize, this.env, this.alias);
@@ -9204,7 +9235,7 @@ var ClickToPay = /*#__PURE__*/function (_SRC) {
9204
9235
  throw new Error('Invalid customer data format. Must include at least email or phone.');
9205
9236
  }
9206
9237
  if (!this.provider) {
9207
- throw new Error('Widget not initialized. Call load() first.');
9238
+ throw new Error('ClickToPay is not ready. Please call `load` method first.');
9208
9239
  }
9209
9240
  this.provider.injectCustomerData(customerData);
9210
9241
  }
@@ -13182,7 +13213,7 @@ var EVENT$2 = {
13182
13213
  ON_CHECKOUT_CLOSE: EventEnum.ON_CHECKOUT_CLOSE
13183
13214
  };
13184
13215
  /**
13185
- * Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay, Flypay V2, Paypal, Afterpay)
13216
+ * Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay V2, Paypal, Afterpay)
13186
13217
  * @constructor
13187
13218
  *
13188
13219
  * @example
@@ -13299,7 +13330,7 @@ var WalletButtons = /*#__PURE__*/function () {
13299
13330
  }
13300
13331
  /**
13301
13332
  * Triggers the update process of the wallet, if available.
13302
- * Currently supported by Flypay, Paypal and ApplePay/GooglePay via MPGS Wallets.
13333
+ * Currently supported by Paypal and ApplePay/GooglePay via MPGS Wallets.
13303
13334
  *
13304
13335
  * @example
13305
13336
  * var button = new WalletButtons(
@@ -13419,7 +13450,7 @@ var WalletButtons = /*#__PURE__*/function () {
13419
13450
  * });
13420
13451
  * // or
13421
13452
  * button.on('unavailable').then(function () {
13422
- * console.log('No button is available);
13453
+ * console.log('No button is available');
13423
13454
  * });
13424
13455
  *
13425
13456
  * @param {string} eventName - Available event names [EVENT]{@link EVENT}
@@ -15173,6 +15204,21 @@ var MultiWidget = /*#__PURE__*/function () {
15173
15204
  error: error
15174
15205
  });
15175
15206
  }
15207
+ /**
15208
+ * The Current method can set a consent checkbox to save card
15209
+ *
15210
+ * @example
15211
+ * widget.enableSaveCardConsentCheckbox();
15212
+ *
15213
+ */
15214
+ }, {
15215
+ key: "enableSaveCardConsentCheckbox",
15216
+ value: function enableSaveCardConsentCheckbox() {
15217
+ var _a, _b, _c;
15218
+ if (((_c = (_b = (_a = this.configs[0]) === null || _a === void 0 ? void 0 : _a.getConfigs()) === null || _b === void 0 ? void 0 : _b.predefined_fields) === null || _c === void 0 ? void 0 : _c.type) === 'card') {
15219
+ this.setFormValue('save_card_consent_accepted', 'false');
15220
+ }
15221
+ }
15176
15222
  }]);
15177
15223
  }();
15178
15224
 
@@ -19270,7 +19316,7 @@ var PayPalSavePaymentSourceWidget = /*#__PURE__*/function () {
19270
19316
  }]);
19271
19317
  }();
19272
19318
 
19273
- window.postMessage("PAYDOCK_PAYMENTS_WIDGET_LOADED");
19319
+ window.postMessage('PAYDOCK_PAYMENTS_WIDGET_LOADED');
19274
19320
 
19275
19321
  class Timer {
19276
19322
  constructor(opts, ms) {
@@ -281,6 +281,7 @@ declare const FORM_FIELD: {
281
281
  ADDRESS_CITY: string;
282
282
  ADDRESS_POSTCODE: string;
283
283
  ADDRESS_COMPANY: string;
284
+ SAVE_CARD_CONSENT_ACCEPTED: string;
284
285
  };
285
286
  declare const STYLE: {
286
287
  BACKGROUND_COLOR: string;
@@ -455,6 +456,7 @@ interface IParams extends IStyles$1, ITexts, ICommonParams {
455
456
  vault_display_token?: string;
456
457
  sdk_origin?: boolean;
457
458
  hide_ui_errors?: boolean;
459
+ save_card_consent_accepted?: string;
458
460
  }
459
461
  interface ICountryPhoneMask {
460
462
  preferred_countries?: string[];
@@ -1215,6 +1217,14 @@ declare class MultiWidget {
1215
1217
  setLanguage(code: any): void;
1216
1218
  getLink(): Link;
1217
1219
  protected handleErrorEvent(event: EventTypes, error: IEventError, purpose: PURPOSE): void;
1220
+ /**
1221
+ * The Current method can set a consent checkbox to save card
1222
+ *
1223
+ * @example
1224
+ * widget.enableSaveCardConsentCheckbox();
1225
+ *
1226
+ */
1227
+ enableSaveCardConsentCheckbox(): void;
1218
1228
  }
1219
1229
 
1220
1230
  interface ITriggerData {
@@ -3203,6 +3213,7 @@ declare class ClickToPay extends SRC {
3203
3213
  protected public_key_or_access_token: string;
3204
3214
  protected meta: IClickToPayMeta;
3205
3215
  protected holdingForCustomerData: boolean;
3216
+ private pendingCustomerData;
3206
3217
  /** @constructs */ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IClickToPayMeta);
3207
3218
  /**
3208
3219
  * The final method after configuring the SRC to start the load process of Click To Pay checkout
@@ -3442,7 +3453,7 @@ interface IWalletUpdateData {
3442
3453
  success: boolean;
3443
3454
  }
3444
3455
  /**
3445
- * Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay, Flypay V2, Paypal, Afterpay)
3456
+ * Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay V2, Paypal, Afterpay)
3446
3457
  * @constructor
3447
3458
  *
3448
3459
  * @example
@@ -3477,7 +3488,7 @@ declare class WalletButtons {
3477
3488
  load(): void;
3478
3489
  /**
3479
3490
  * Triggers the update process of the wallet, if available.
3480
- * Currently supported by Flypay, Paypal and ApplePay/GooglePay via MPGS Wallets.
3491
+ * Currently supported by Paypal and ApplePay/GooglePay via MPGS Wallets.
3481
3492
  *
3482
3493
  * @example
3483
3494
  * var button = new WalletButtons(
package/bundles/index.mjs CHANGED
@@ -952,7 +952,7 @@ SDK.headerKeys = Object.freeze({
952
952
  version: 'x-sdk-version',
953
953
  type: 'x-sdk-type'
954
954
  });
955
- SDK._version = 'v1.127.1-beta';
955
+ SDK._version = 'v1.128.2';
956
956
 
957
957
  /******************************************************************************
958
958
  Copyright (c) Microsoft Corporation.
@@ -5755,7 +5755,8 @@ var FORM_FIELD$1 = {
5755
5755
  ADDRESS_COUNTRY: 'address_country',
5756
5756
  ADDRESS_CITY: 'address_city',
5757
5757
  ADDRESS_POSTCODE: 'address_postcode',
5758
- ADDRESS_COMPANY: 'address_company'
5758
+ ADDRESS_COMPANY: 'address_company',
5759
+ SAVE_CARD_CONSENT_ACCEPTED: 'save_card_consent_accepted'
5759
5760
  };
5760
5761
  var STYLE$2 = {
5761
5762
  BACKGROUND_COLOR: 'background_color',
@@ -8656,51 +8657,6 @@ var HtmlPaymentSourceWidget = /*#__PURE__*/function (_PaymentSourceWidget) {
8656
8657
  }]);
8657
8658
  }(PaymentSourceWidget);
8658
8659
 
8659
- /**
8660
- * List of available event's name in the Click To Pay checkout lifecycle
8661
- * @enum EVENT
8662
- *
8663
- * @type {object}
8664
- * @param {string} IFRAME_LOADED=iframeLoaded Initial event sent when IFrame is initially loaded.
8665
- * @param {string} CHECKOUT_READY=checkoutReady Event sent when checkout is loaded and ready to be used by customer. Leverage alongside [showCheckout](#SRC+showCheckout) and [hideCheckout](#SRC+hideCheckout).
8666
- * @param {string} CHECKOUT_POPUP_OPEN=checkoutPopupOpen Event sent when Click To Pay checkout flow is started, regardless of embedded or windowed mode.
8667
- * @param {string} CHECKOUT_POPUP_CLOSE=checkoutPopupClose Event sent when Click To Pay checkout flow is closed, regardless of embedded or windowed mode.
8668
- * @param {string} CHECKOUT_COMPLETED=checkoutCompleted Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information.
8669
- * @param {string} CHECKOUT_ERROR=checkoutError Event sent on error checkout by customer. Check [data](#EventData) for more information.
8670
- */
8671
- var EVENT$3;
8672
- (function (EVENT) {
8673
- EVENT["IFRAME_LOADED"] = "iframeLoaded";
8674
- EVENT["CHECKOUT_READY"] = "checkoutReady";
8675
- EVENT["CHECKOUT_COMPLETED"] = "checkoutCompleted";
8676
- EVENT["CHECKOUT_ERROR"] = "checkoutError";
8677
- EVENT["CHECKOUT_POPUP_OPEN"] = "checkoutPopupOpen";
8678
- EVENT["CHECKOUT_POPUP_CLOSE"] = "checkoutPopupClose";
8679
- })(EVENT$3 || (EVENT$3 = {}));
8680
- /**
8681
- * List of available event data types
8682
- * @enum EVENT_DATA_TYPE
8683
- *
8684
- * @type {object}
8685
- * @param {string} CRITICAL_ERROR=CriticalError in this error scenario the checkout is understood to be in a non-recoverable state and should be closed by the merchant and give alternate payment options to the user
8686
- * @param {string} USER_ERROR=UserError in this error scenario the error in likely a user input error and the checkout is in a recoverable state, so the user will be kept within the checkout and can retry the flow
8687
- * @param {string} SUCCESS=Success
8688
- */
8689
- var EVENT_DATA_TYPE;
8690
- (function (EVENT_DATA_TYPE) {
8691
- EVENT_DATA_TYPE["CRITICAL_ERROR"] = "CriticalError";
8692
- EVENT_DATA_TYPE["USER_ERROR"] = "UserError";
8693
- EVENT_DATA_TYPE["SUCCESS"] = "Success";
8694
- })(EVENT_DATA_TYPE || (EVENT_DATA_TYPE = {}));
8695
- var STYLE = {
8696
- PRIMARY_BUTTON_COLOR: 'primary_button_color',
8697
- SECONDARY_BUTTON_COLOR: 'secondary_button_color',
8698
- PRIMARY_BUTTON_TEXT_COLOR: 'primary_button_text_color',
8699
- SECONDARY_BUTTON_TEXT_COLOR: 'secondary_button_text_color',
8700
- FONT_FAMILY: 'font_family',
8701
- ENABLE_SRC_POPUP: 'enable_src_popup'
8702
- };
8703
-
8704
8660
  /**
8705
8661
  * Interface for classes that represent a trigger data.
8706
8662
  * @interface ITriggerData
@@ -8754,6 +8710,51 @@ var Trigger = /*#__PURE__*/function () {
8754
8710
  }]);
8755
8711
  }();
8756
8712
 
8713
+ /**
8714
+ * List of available event's name in the Click To Pay checkout lifecycle
8715
+ * @enum EVENT
8716
+ *
8717
+ * @type {object}
8718
+ * @param {string} IFRAME_LOADED=iframeLoaded Initial event sent when IFrame is initially loaded.
8719
+ * @param {string} CHECKOUT_READY=checkoutReady Event sent when checkout is loaded and ready to be used by customer. Leverage alongside [showCheckout](#SRC+showCheckout) and [hideCheckout](#SRC+hideCheckout).
8720
+ * @param {string} CHECKOUT_POPUP_OPEN=checkoutPopupOpen Event sent when Click To Pay checkout flow is started, regardless of embedded or windowed mode.
8721
+ * @param {string} CHECKOUT_POPUP_CLOSE=checkoutPopupClose Event sent when Click To Pay checkout flow is closed, regardless of embedded or windowed mode.
8722
+ * @param {string} CHECKOUT_COMPLETED=checkoutCompleted Event sent on successful checkout by customer. Check [data](#EventDataCheckoutCompletedData) for more information.
8723
+ * @param {string} CHECKOUT_ERROR=checkoutError Event sent on error checkout by customer. Check [data](#EventData) for more information.
8724
+ */
8725
+ var EVENT$3;
8726
+ (function (EVENT) {
8727
+ EVENT["IFRAME_LOADED"] = "iframeLoaded";
8728
+ EVENT["CHECKOUT_READY"] = "checkoutReady";
8729
+ EVENT["CHECKOUT_COMPLETED"] = "checkoutCompleted";
8730
+ EVENT["CHECKOUT_ERROR"] = "checkoutError";
8731
+ EVENT["CHECKOUT_POPUP_OPEN"] = "checkoutPopupOpen";
8732
+ EVENT["CHECKOUT_POPUP_CLOSE"] = "checkoutPopupClose";
8733
+ })(EVENT$3 || (EVENT$3 = {}));
8734
+ /**
8735
+ * List of available event data types
8736
+ * @enum EVENT_DATA_TYPE
8737
+ *
8738
+ * @type {object}
8739
+ * @param {string} CRITICAL_ERROR=CriticalError in this error scenario the checkout is understood to be in a non-recoverable state and should be closed by the merchant and give alternate payment options to the user
8740
+ * @param {string} USER_ERROR=UserError in this error scenario the error in likely a user input error and the checkout is in a recoverable state, so the user will be kept within the checkout and can retry the flow
8741
+ * @param {string} SUCCESS=Success
8742
+ */
8743
+ var EVENT_DATA_TYPE;
8744
+ (function (EVENT_DATA_TYPE) {
8745
+ EVENT_DATA_TYPE["CRITICAL_ERROR"] = "CriticalError";
8746
+ EVENT_DATA_TYPE["USER_ERROR"] = "UserError";
8747
+ EVENT_DATA_TYPE["SUCCESS"] = "Success";
8748
+ })(EVENT_DATA_TYPE || (EVENT_DATA_TYPE = {}));
8749
+ var STYLE = {
8750
+ PRIMARY_BUTTON_COLOR: 'primary_button_color',
8751
+ SECONDARY_BUTTON_COLOR: 'secondary_button_color',
8752
+ PRIMARY_BUTTON_TEXT_COLOR: 'primary_button_text_color',
8753
+ SECONDARY_BUTTON_TEXT_COLOR: 'secondary_button_text_color',
8754
+ FONT_FAMILY: 'font_family',
8755
+ ENABLE_SRC_POPUP: 'enable_src_popup'
8756
+ };
8757
+
8757
8758
  var PerformanceService = /*#__PURE__*/function () {
8758
8759
  function PerformanceService() {
8759
8760
  _classCallCheck(this, PerformanceService);
@@ -8859,9 +8860,20 @@ var PerformanceService = /*#__PURE__*/function () {
8859
8860
  var ClickToPaySRC = /*#__PURE__*/function () {
8860
8861
  function ClickToPaySRC(iframe_selector, service_id, public_key, meta, eventEmitter, autoResize, env, alias) {
8861
8862
  _classCallCheck(this, ClickToPaySRC);
8863
+ var _a, _b, _c;
8862
8864
  this.meta = meta;
8863
8865
  this.eventEmitter = eventEmitter;
8864
8866
  this.autoResize = autoResize;
8867
+ this.isIframeLoaded = false;
8868
+ this.injectedCustomerData = null;
8869
+ if (meta.dpa_config) {
8870
+ var hasAllRawDpaConfig = !!(((_a = this.meta.dpa_config) === null || _a === void 0 ? void 0 : _a.dpa_id) && ((_b = this.meta.dpa_config) === null || _b === void 0 ? void 0 : _b.dpa_name) && ((_c = this.meta.dpa_config) === null || _c === void 0 ? void 0 : _c.dpa_supported_card_schemes));
8871
+ // if doesnt have all fields remove dpa_config from meta
8872
+ if (!hasAllRawDpaConfig) {
8873
+ console.warn('DPA config is missing some required fields, removing it from meta');
8874
+ delete meta.dpa_config;
8875
+ }
8876
+ }
8865
8877
  this.link = new Link(MASTERCARD_SRC);
8866
8878
  this.link.setParams(_extends({
8867
8879
  service_id: service_id,
@@ -8924,7 +8936,12 @@ var ClickToPaySRC = /*#__PURE__*/function () {
8924
8936
  if (iframeElement) {
8925
8937
  iframeElement.setAttribute('allow', 'payment; accelerometer;');
8926
8938
  iframeElement.onload = function () {
8927
- return _this2.eventEmitter.emit(EVENT$3.IFRAME_LOADED, {});
8939
+ _this2.isIframeLoaded = true;
8940
+ _this2.eventEmitter.emit(EVENT$3.IFRAME_LOADED, {});
8941
+ if (_this2.injectedCustomerData) {
8942
+ _this2.injectCustomerData(_this2.injectedCustomerData);
8943
+ _this2.injectedCustomerData = null;
8944
+ }
8928
8945
  };
8929
8946
  }
8930
8947
  }
@@ -8975,6 +8992,10 @@ var ClickToPaySRC = /*#__PURE__*/function () {
8975
8992
  }, {
8976
8993
  key: "injectCustomerData",
8977
8994
  value: function injectCustomerData(customerData) {
8995
+ if (!this.isIframeLoaded) {
8996
+ this.injectedCustomerData = customerData;
8997
+ return;
8998
+ }
8978
8999
  this.trigger.push(TRIGGER$1.INJECT_CUSTOMER_DATA, {
8979
9000
  customer: customerData
8980
9001
  });
@@ -9168,6 +9189,14 @@ var ClickToPay = /*#__PURE__*/function (_SRC) {
9168
9189
  _this.public_key_or_access_token = public_key_or_access_token;
9169
9190
  _this.meta = meta;
9170
9191
  _this.holdingForCustomerData = false;
9192
+ _this.pendingCustomerData = null;
9193
+ // Dequeue customer data only when the iframe has loaded
9194
+ _this.on('iframeLoaded', function () {
9195
+ if (_this.pendingCustomerData && _this.provider) {
9196
+ _this.provider.injectCustomerData(_this.pendingCustomerData);
9197
+ _this.pendingCustomerData = null;
9198
+ }
9199
+ });
9171
9200
  return _this;
9172
9201
  }
9173
9202
  /**
@@ -9177,7 +9206,9 @@ var ClickToPay = /*#__PURE__*/function (_SRC) {
9177
9206
  return _createClass(ClickToPay, [{
9178
9207
  key: "load",
9179
9208
  value: function load() {
9180
- if (this.provider) return;
9209
+ if (this.provider) {
9210
+ return;
9211
+ }
9181
9212
  this.meta.customizations = this.style;
9182
9213
  this.holdingForCustomerData = !!this.meta.hold_for_customer_data;
9183
9214
  this.provider = new ClickToPaySRC(this.iframe_selector, this.service_id, this.public_key_or_access_token, this.meta, this.eventEmitter, this.autoResize, this.env, this.alias);
@@ -9202,7 +9233,7 @@ var ClickToPay = /*#__PURE__*/function (_SRC) {
9202
9233
  throw new Error('Invalid customer data format. Must include at least email or phone.');
9203
9234
  }
9204
9235
  if (!this.provider) {
9205
- throw new Error('Widget not initialized. Call load() first.');
9236
+ throw new Error('ClickToPay is not ready. Please call `load` method first.');
9206
9237
  }
9207
9238
  this.provider.injectCustomerData(customerData);
9208
9239
  }
@@ -13180,7 +13211,7 @@ var EVENT$2 = {
13180
13211
  ON_CHECKOUT_CLOSE: EventEnum.ON_CHECKOUT_CLOSE
13181
13212
  };
13182
13213
  /**
13183
- * Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay, Flypay V2, Paypal, Afterpay)
13214
+ * Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay V2, Paypal, Afterpay)
13184
13215
  * @constructor
13185
13216
  *
13186
13217
  * @example
@@ -13297,7 +13328,7 @@ var WalletButtons = /*#__PURE__*/function () {
13297
13328
  }
13298
13329
  /**
13299
13330
  * Triggers the update process of the wallet, if available.
13300
- * Currently supported by Flypay, Paypal and ApplePay/GooglePay via MPGS Wallets.
13331
+ * Currently supported by Paypal and ApplePay/GooglePay via MPGS Wallets.
13301
13332
  *
13302
13333
  * @example
13303
13334
  * var button = new WalletButtons(
@@ -13417,7 +13448,7 @@ var WalletButtons = /*#__PURE__*/function () {
13417
13448
  * });
13418
13449
  * // or
13419
13450
  * button.on('unavailable').then(function () {
13420
- * console.log('No button is available);
13451
+ * console.log('No button is available');
13421
13452
  * });
13422
13453
  *
13423
13454
  * @param {string} eventName - Available event names [EVENT]{@link EVENT}
@@ -15171,6 +15202,21 @@ var MultiWidget = /*#__PURE__*/function () {
15171
15202
  error: error
15172
15203
  });
15173
15204
  }
15205
+ /**
15206
+ * The Current method can set a consent checkbox to save card
15207
+ *
15208
+ * @example
15209
+ * widget.enableSaveCardConsentCheckbox();
15210
+ *
15211
+ */
15212
+ }, {
15213
+ key: "enableSaveCardConsentCheckbox",
15214
+ value: function enableSaveCardConsentCheckbox() {
15215
+ var _a, _b, _c;
15216
+ if (((_c = (_b = (_a = this.configs[0]) === null || _a === void 0 ? void 0 : _a.getConfigs()) === null || _b === void 0 ? void 0 : _b.predefined_fields) === null || _c === void 0 ? void 0 : _c.type) === 'card') {
15217
+ this.setFormValue('save_card_consent_accepted', 'false');
15218
+ }
15219
+ }
15174
15220
  }]);
15175
15221
  }();
15176
15222
 
@@ -19268,7 +19314,7 @@ var PayPalSavePaymentSourceWidget = /*#__PURE__*/function () {
19268
19314
  }]);
19269
19315
  }();
19270
19316
 
19271
- window.postMessage("PAYDOCK_PAYMENTS_WIDGET_LOADED");
19317
+ window.postMessage('PAYDOCK_PAYMENTS_WIDGET_LOADED');
19272
19318
 
19273
19319
  class Timer {
19274
19320
  constructor(opts, ms) {
@@ -281,6 +281,7 @@ declare const FORM_FIELD: {
281
281
  ADDRESS_CITY: string;
282
282
  ADDRESS_POSTCODE: string;
283
283
  ADDRESS_COMPANY: string;
284
+ SAVE_CARD_CONSENT_ACCEPTED: string;
284
285
  };
285
286
  declare const STYLE: {
286
287
  BACKGROUND_COLOR: string;
@@ -455,6 +456,7 @@ interface IParams extends IStyles$1, ITexts, ICommonParams {
455
456
  vault_display_token?: string;
456
457
  sdk_origin?: boolean;
457
458
  hide_ui_errors?: boolean;
459
+ save_card_consent_accepted?: string;
458
460
  }
459
461
  interface ICountryPhoneMask {
460
462
  preferred_countries?: string[];
@@ -1215,6 +1217,14 @@ declare class MultiWidget {
1215
1217
  setLanguage(code: any): void;
1216
1218
  getLink(): Link;
1217
1219
  protected handleErrorEvent(event: EventTypes, error: IEventError, purpose: PURPOSE): void;
1220
+ /**
1221
+ * The Current method can set a consent checkbox to save card
1222
+ *
1223
+ * @example
1224
+ * widget.enableSaveCardConsentCheckbox();
1225
+ *
1226
+ */
1227
+ enableSaveCardConsentCheckbox(): void;
1218
1228
  }
1219
1229
 
1220
1230
  interface ITriggerData {
@@ -3203,6 +3213,7 @@ declare class ClickToPay extends SRC {
3203
3213
  protected public_key_or_access_token: string;
3204
3214
  protected meta: IClickToPayMeta;
3205
3215
  protected holdingForCustomerData: boolean;
3216
+ private pendingCustomerData;
3206
3217
  /** @constructs */ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IClickToPayMeta);
3207
3218
  /**
3208
3219
  * The final method after configuring the SRC to start the load process of Click To Pay checkout
@@ -3442,7 +3453,7 @@ interface IWalletUpdateData {
3442
3453
  success: boolean;
3443
3454
  }
3444
3455
  /**
3445
- * Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay, Flypay V2, Paypal, Afterpay)
3456
+ * Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay V2, Paypal, Afterpay)
3446
3457
  * @constructor
3447
3458
  *
3448
3459
  * @example
@@ -3477,7 +3488,7 @@ declare class WalletButtons {
3477
3488
  load(): void;
3478
3489
  /**
3479
3490
  * Triggers the update process of the wallet, if available.
3480
- * Currently supported by Flypay, Paypal and ApplePay/GooglePay via MPGS Wallets.
3491
+ * Currently supported by Paypal and ApplePay/GooglePay via MPGS Wallets.
3481
3492
  *
3482
3493
  * @example
3483
3494
  * var button = new WalletButtons(
@@ -1 +1 @@
1
- {"version":3,"file":"additionals.d.ts","sourceRoot":"","sources":["../../../src/checkout/layout-widgets/additionals.ts"],"names":[],"mappings":";AAAA,wBA2FC"}
1
+ {"version":3,"file":"additionals.d.ts","sourceRoot":"","sources":["../../../src/checkout/layout-widgets/additionals.ts"],"names":[],"mappings":";AAAA,wBA2FE"}
@@ -1 +1 @@
1
- {"version":3,"file":"payment-template.d.ts","sourceRoot":"","sources":["../../../src/checkout/layout-widgets/payment-template.ts"],"names":[],"mappings":";AAAA,wBAoTC"}
1
+ {"version":3,"file":"payment-template.d.ts","sourceRoot":"","sources":["../../../src/checkout/layout-widgets/payment-template.ts"],"names":[],"mappings":";AAAA,wBAoTE"}
@@ -32,6 +32,7 @@ export declare const FORM_FIELD: {
32
32
  ADDRESS_CITY: string;
33
33
  ADDRESS_POSTCODE: string;
34
34
  ADDRESS_COMPANY: string;
35
+ SAVE_CARD_CONSENT_ACCEPTED: string;
35
36
  };
36
37
  export declare const STYLE: {
37
38
  BACKGROUND_COLOR: string;
@@ -207,6 +208,7 @@ export interface IParams extends IStyles, ITexts, ICommonParams {
207
208
  vault_display_token?: string;
208
209
  sdk_origin?: boolean;
209
210
  hide_ui_errors?: boolean;
211
+ save_card_consent_accepted?: string;
210
212
  }
211
213
  export interface ICountryPhoneMask {
212
214
  preferred_countries?: string[];