From 9afa6ef0d36e9206b576ce34169241f107049e7e Mon Sep 17 00:00:00 2001 From: Melinda Sava Date: Wed, 25 Mar 2026 09:20:45 +0100 Subject: [PATCH 1/4] PIQ-4392: Prepare for url debranding --- README.md | 18 ++++++++---------- dist/esm/sdk/api/index.js | 2 +- dist/sdk/api/index.js | 2 +- src/sdk/api/index.js | 25 +++++++++++++++++++++---- 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index ef94b0f..ae58282 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ Hosted fields SDK is a toolkit that allows you generate a form/set of fields. It > [!CAUTION] > **Migration and Deprecation Notice:** Starting from version 1.0.50, it is mandatory to use the `'https://card-fields.paymentiq.io/1.1.1/index.html'` as `hostedfieldsurl` value for **production** environments. Please update your configurations accordingly to avoid potential disruptions. > -> The old hostedfieldsurl: `'https://hostedpages.paymentiq.io/1.0.51/index.html'` and well as *all versions previous to 1.0.50* **will be deprecated starting 15 March 2025**. Please note that using older versions and the old domain may expose your system to potential risks. Starting with version 1.1.1, **hostedpages** domain will not be used anymore. +> The old hostedfieldsurl: `'https://hostedpages.paymentiq.io/1.0.51/index.html'` and well as *all versions previous to 1.0.50* **are deprecated**. Please note that using older versions and the old domain may expose your system to potential risks. Starting with version 1.1.1, **hostedpages** domain will not be used anymore. > -> This change is meant to enhance security and future compliance with the new requirements in the Payment Card Industry Data Security Standards. The old domain is scheduled for deprecation. We advise all users to transition to the new domain as soon as possible to maintain compliance and benefit from improved security measures. +> This change is meant to enhance security and future compliance with the new requirements in the Payment Card Industry Data Security Standards. We advise all users to transition to the new domain as soon as possible to maintain compliance and benefit from improved security measures. > > Obs. **The new domain supports versions starting with 1.0.50 and above.** Make sure your implementation is updated to at least this version to ensure compatibility. > @@ -185,8 +185,8 @@ For production environments use `'https://card-fields.paymentiq.io/1.1.1/index.h - 1.0.51 - 1.0.50 -> [!WARNING] -> Please note that **previous versions**(older than 1.0.50), as well as old domain name ***hostedpages* will be deprecated and must be updated by 15 March 2025**. +> [!NOTE] +> Versions older than 1.0.50 are no longer supported. **get** @@ -468,12 +468,10 @@ If any errors are detected, an error message will be returned as the value of th ```` -### Migration Notice +### Notes -#### Domain Change Explanation and Disclaimer - -Overview of Change: -We have recently updated the domain used for our card fields to enhance security and compliance with current standards. The old domain, while PCI DSS compliant, is scheduled for deprecation. We advise all users to transition to the new domain as soon as possible to maintain compliance and benefit from improved security measures. +#### Minimum Supported Version +Version 1.0.50 or later is required. Older versions are no longer supported. #### New Domain: Domain: `card-fields.paymentiq.io/1.1.1/` @@ -490,7 +488,7 @@ Upgrade Your Version: Ensure your integration uses version 1.0.50 or later. Migrate to the New Domain: Begin using the new domain by updating your configurations accordingly. #### Deprecation Timeline: -Old Domain: The old domain will be deprecated on 15 March, after which it will no longer be supported. +Old Domain: The old domain is deprecated and no longer supported. #### Additional Notes: Reach out to our support team if you encounter any issues during the transition or require further assistance. diff --git a/dist/esm/sdk/api/index.js b/dist/esm/sdk/api/index.js index f60992b..50caac6 100644 --- a/dist/esm/sdk/api/index.js +++ b/dist/esm/sdk/api/index.js @@ -1 +1 @@ -import _typeof from"@babel/runtime/helpers/typeof";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var merchantId,renderMode,fields,hostedfieldsurl,service,styles,_excluded=["errors"],_excluded2=["errors"];function ownKeys(t,e){var a,r=Object.keys(t);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(t),e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,a)),r}function _objectSpread(t){for(var e=1;e{var e=_getGlobalObject();e.__rewire_reset_all__||(e.__rewire_reset_all__=function(){e.__$$GLOBAL_REWIRE_REGISTRY__=Object.create(null)})})();var INTENTIONAL_UNDEFINED="__INTENTIONAL_UNDEFINED__",_RewireAPI__={};function _get__(e){var t=_getRewiredData__();return void 0===t[e]?_get_original__(e):(t=t[e])!==INTENTIONAL_UNDEFINED?t:void 0}function _get_original__(e){switch(e){case"merchantId":return merchantId;case"renderMode":return renderMode;case"hostedfieldsurl":return hostedfieldsurl;case"fields":return fields;case"service":return service;case"styles":return styles;case"callback":return callback;case"onLoadCallback":return onLoadCallback;case"onCardBrandChangeCallback":return onCardBrandChangeCallback;case"onRequestIframeExpandCallback":return onRequestIframeExpandCallback;case"onCancelIframeExpandCallback":return onCancelIframeExpandCallback;case"onClickToPayCheckoutSuccessCallback":return onClickToPayCheckoutSuccessCallback;case"onClickToPayCheckoutErrorCallback":return onClickToPayCheckoutErrorCallback;case"autoFocusNext":return autoFocusNext;case"el":return el;case"clickToPayConfig":return clickToPayConfig;case"clickToPayAttributes":return clickToPayAttributes;case"registerSingleIframe":return registerSingleIframe;case"registerIframes":return registerIframes;case"targets":return targets;case"actions":return actions;case"clickToPayIframe":return clickToPayIframe;case"assertClickToPayIsSet":return assertClickToPayIsSet;case"initIframe":return initIframe;case"initSingleIframe":return initSingleIframe;case"validateOrigin":return validateOrigin;case"responses":return responses;case"sendCallback":return sendCallback;case"recommendedExpandedHeight":return recommendedExpandedHeight;case"get":return get;case"iframeAllowPermissions":return iframeAllowPermissions;case"createIframeProxy":return createIframeProxy;case"handleOnLoad":return handleOnLoad;case"window":return window;case"eventHandler":return eventHandler;case"onLoadCounter":return onLoadCounter;case"createSingleIframeProxy":return createSingleIframeProxy;case"setup":return setup;case"reset":return reset;case"setClickToPayTransactionAmount":return setClickToPayTransactionAmount;case"clickToPayCheckout":return clickToPayCheckout}}function _assign__(e,t){var a=_getRewiredData__();return void 0===a[e]?_set_original__(e,t):a[e]=t}function _set_original__(e,t){switch(e){case"merchantId":return merchantId=t;case"renderMode":return renderMode=t;case"hostedfieldsurl":return hostedfieldsurl=t;case"fields":return fields=t;case"service":return service=t;case"styles":return styles=t;case"callback":return callback=t;case"onLoadCallback":return onLoadCallback=t;case"onCardBrandChangeCallback":return onCardBrandChangeCallback=t;case"onRequestIframeExpandCallback":return onRequestIframeExpandCallback=t;case"onCancelIframeExpandCallback":return onCancelIframeExpandCallback=t;case"onClickToPayCheckoutSuccessCallback":return onClickToPayCheckoutSuccessCallback=t;case"onClickToPayCheckoutErrorCallback":return onClickToPayCheckoutErrorCallback=t;case"autoFocusNext":return autoFocusNext=t;case"el":return el=t;case"clickToPayConfig":return clickToPayConfig=t;case"clickToPayAttributes":return clickToPayAttributes=t;case"targets":return targets=t;case"clickToPayIframe":return clickToPayIframe=t;case"responses":return responses=t;case"onLoadCounter":return onLoadCounter=t}}function _update_operation__(e,t,a){var r=_get__(t),e="++"===e?r+1:r-1;return _assign__(t,e),a?e:r}function _set__(t,e){var a=_getRewiredData__();return"object"===_typeof(t)?(Object.keys(t).forEach(function(e){a[e]=t[e]}),function(){Object.keys(t).forEach(function(e){_reset__(t)})}):(a[t]=void 0===e?INTENTIONAL_UNDEFINED:e,function(){_reset__(t)})}function _reset__(e){var t=_getRewiredData__();delete t[e],0==Object.keys(t).length&&delete _getRewireRegistry__()[_getRewireModuleId__]}function _with__(t){var a=_getRewiredData__(),r=Object.keys(t),n={};function _(){r.forEach(function(e){a[e]=n[e]})}return function(e){r.forEach(function(e){n[e]=a[e],a[e]=t[e]});e=e();return e&&"function"==typeof e.then?e.then(_).catch(_):_(),e}}(()=>{function e(e,t){Object.defineProperty(_RewireAPI__,e,{value:t,enumerable:!1,configurable:!0})}e("__get__",_get__),e("__GetDependency__",_get__),e("__Rewire__",_set__),e("__set__",_set__),e("__reset__",_reset__),e("__ResetDependency__",_reset__),e("__with__",_with__)})();export default _RewireAPI__;export{HostedFields,_get__ as __get__,_get__ as __GetDependency__,_set__ as __Rewire__,_set__ as __set__,_reset__ as __ResetDependency__,_RewireAPI__ as __RewireAPI__}; \ No newline at end of file +import _typeof from"@babel/runtime/helpers/typeof";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";var merchantId,renderMode,fields,hostedfieldsurl,service,styles,_excluded=["errors"],_excluded2=["errors"];function ownKeys(t,e){var a,r=Object.keys(t);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(t),e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,a)),r}function _objectSpread(t){for(var e=1;e{var e=_getGlobalObject();e.__rewire_reset_all__||(e.__rewire_reset_all__=function(){e.__$$GLOBAL_REWIRE_REGISTRY__=Object.create(null)})})();var INTENTIONAL_UNDEFINED="__INTENTIONAL_UNDEFINED__",_RewireAPI__={};function _get__(e){var t=_getRewiredData__();return void 0===t[e]?_get_original__(e):(t=t[e])!==INTENTIONAL_UNDEFINED?t:void 0}function _get_original__(e){switch(e){case"merchantId":return merchantId;case"renderMode":return renderMode;case"hostedfieldsurl":return hostedfieldsurl;case"fields":return fields;case"service":return service;case"styles":return styles;case"callback":return callback;case"onLoadCallback":return onLoadCallback;case"onCardBrandChangeCallback":return onCardBrandChangeCallback;case"onRequestIframeExpandCallback":return onRequestIframeExpandCallback;case"onCancelIframeExpandCallback":return onCancelIframeExpandCallback;case"onClickToPayCheckoutSuccessCallback":return onClickToPayCheckoutSuccessCallback;case"onClickToPayCheckoutErrorCallback":return onClickToPayCheckoutErrorCallback;case"autoFocusNext":return autoFocusNext;case"el":return el;case"clickToPayConfig":return clickToPayConfig;case"clickToPayAttributes":return clickToPayAttributes;case"allowedOrigins":return allowedOrigins;case"extractOrigin":return extractOrigin;case"registerSingleIframe":return registerSingleIframe;case"registerIframes":return registerIframes;case"targets":return targets;case"actions":return actions;case"clickToPayIframe":return clickToPayIframe;case"assertClickToPayIsSet":return assertClickToPayIsSet;case"initIframe":return initIframe;case"initSingleIframe":return initSingleIframe;case"validateOrigin":return validateOrigin;case"responses":return responses;case"sendCallback":return sendCallback;case"recommendedExpandedHeight":return recommendedExpandedHeight;case"get":return get;case"iframeAllowPermissions":return iframeAllowPermissions;case"createIframeProxy":return createIframeProxy;case"handleOnLoad":return handleOnLoad;case"window":return window;case"eventHandler":return eventHandler;case"onLoadCounter":return onLoadCounter;case"createSingleIframeProxy":return createSingleIframeProxy;case"setup":return setup;case"reset":return reset;case"setClickToPayTransactionAmount":return setClickToPayTransactionAmount;case"clickToPayCheckout":return clickToPayCheckout}}function _assign__(e,t){var a=_getRewiredData__();return void 0===a[e]?_set_original__(e,t):a[e]=t}function _set_original__(e,t){switch(e){case"merchantId":return merchantId=t;case"renderMode":return renderMode=t;case"hostedfieldsurl":return hostedfieldsurl=t;case"fields":return fields=t;case"service":return service=t;case"styles":return styles=t;case"callback":return callback=t;case"onLoadCallback":return onLoadCallback=t;case"onCardBrandChangeCallback":return onCardBrandChangeCallback=t;case"onRequestIframeExpandCallback":return onRequestIframeExpandCallback=t;case"onCancelIframeExpandCallback":return onCancelIframeExpandCallback=t;case"onClickToPayCheckoutSuccessCallback":return onClickToPayCheckoutSuccessCallback=t;case"onClickToPayCheckoutErrorCallback":return onClickToPayCheckoutErrorCallback=t;case"autoFocusNext":return autoFocusNext=t;case"el":return el=t;case"clickToPayConfig":return clickToPayConfig=t;case"clickToPayAttributes":return clickToPayAttributes=t;case"allowedOrigins":return allowedOrigins=t;case"targets":return targets=t;case"clickToPayIframe":return clickToPayIframe=t;case"responses":return responses=t;case"onLoadCounter":return onLoadCounter=t}}function _update_operation__(e,t,a){var r=_get__(t),e="++"===e?r+1:r-1;return _assign__(t,e),a?e:r}function _set__(t,e){var a=_getRewiredData__();return"object"===_typeof(t)?(Object.keys(t).forEach(function(e){a[e]=t[e]}),function(){Object.keys(t).forEach(function(e){_reset__(t)})}):(a[t]=void 0===e?INTENTIONAL_UNDEFINED:e,function(){_reset__(t)})}function _reset__(e){var t=_getRewiredData__();delete t[e],0==Object.keys(t).length&&delete _getRewireRegistry__()[_getRewireModuleId__]}function _with__(t){var a=_getRewiredData__(),r=Object.keys(t),n={};function _(){r.forEach(function(e){a[e]=n[e]})}return function(e){r.forEach(function(e){n[e]=a[e],a[e]=t[e]});e=e();return e&&"function"==typeof e.then?e.then(_).catch(_):_(),e}}(()=>{function e(e,t){Object.defineProperty(_RewireAPI__,e,{value:t,enumerable:!1,configurable:!0})}e("__get__",_get__),e("__GetDependency__",_get__),e("__Rewire__",_set__),e("__set__",_set__),e("__reset__",_reset__),e("__ResetDependency__",_reset__),e("__with__",_with__)})();export default _RewireAPI__;export{HostedFields,_get__ as __get__,_get__ as __GetDependency__,_set__ as __Rewire__,_set__ as __set__,_reset__ as __ResetDependency__,_RewireAPI__ as __RewireAPI__}; \ No newline at end of file diff --git a/dist/sdk/api/index.js b/dist/sdk/api/index.js index 318a7a1..0c0ef05 100644 --- a/dist/sdk/api/index.js +++ b/dist/sdk/api/index.js @@ -1 +1 @@ -var merchantId,renderMode,fields,hostedfieldsurl,service,styles,_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault"),_typeof=require("@babel/runtime/helpers/typeof"),_defineProperty2=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.HostedFields=void 0,exports.__ResetDependency__=_reset__,exports.__RewireAPI__=void 0,exports.__set__=exports.__Rewire__=_set__,exports.__GetDependency__=exports.__get__=_get__,exports.default=void 0,_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"))),_objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")),_actions=require("./actions"),_excluded=["errors"],_excluded2=["errors"];function ownKeys(t,e){var a,r=Object.keys(t);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(t),e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,a)),r}function _objectSpread(t){for(var e=1;e{var e=_getGlobalObject();e.__rewire_reset_all__||(e.__rewire_reset_all__=function(){e.__$$GLOBAL_REWIRE_REGISTRY__=Object.create(null)})})();var INTENTIONAL_UNDEFINED="__INTENTIONAL_UNDEFINED__",_RewireAPI__=exports.__RewireAPI__={};function _get__(e){var t=_getRewiredData__();return void 0===t[e]?_get_original__(e):(t=t[e])!==INTENTIONAL_UNDEFINED?t:void 0}function _get_original__(e){switch(e){case"merchantId":return merchantId;case"renderMode":return renderMode;case"hostedfieldsurl":return hostedfieldsurl;case"fields":return fields;case"service":return service;case"styles":return styles;case"callback":return callback;case"onLoadCallback":return onLoadCallback;case"onCardBrandChangeCallback":return onCardBrandChangeCallback;case"onRequestIframeExpandCallback":return onRequestIframeExpandCallback;case"onCancelIframeExpandCallback":return onCancelIframeExpandCallback;case"onClickToPayCheckoutSuccessCallback":return onClickToPayCheckoutSuccessCallback;case"onClickToPayCheckoutErrorCallback":return onClickToPayCheckoutErrorCallback;case"autoFocusNext":return autoFocusNext;case"el":return el;case"clickToPayConfig":return clickToPayConfig;case"clickToPayAttributes":return clickToPayAttributes;case"registerSingleIframe":return registerSingleIframe;case"registerIframes":return registerIframes;case"targets":return targets;case"actions":return _actions.actions;case"clickToPayIframe":return clickToPayIframe;case"assertClickToPayIsSet":return assertClickToPayIsSet;case"initIframe":return initIframe;case"initSingleIframe":return initSingleIframe;case"validateOrigin":return validateOrigin;case"responses":return responses;case"sendCallback":return sendCallback;case"recommendedExpandedHeight":return recommendedExpandedHeight;case"get":return get;case"iframeAllowPermissions":return iframeAllowPermissions;case"createIframeProxy":return createIframeProxy;case"handleOnLoad":return handleOnLoad;case"window":return window;case"eventHandler":return eventHandler;case"onLoadCounter":return onLoadCounter;case"createSingleIframeProxy":return createSingleIframeProxy;case"setup":return setup;case"reset":return reset;case"setClickToPayTransactionAmount":return setClickToPayTransactionAmount;case"clickToPayCheckout":return clickToPayCheckout}}function _assign__(e,t){var a=_getRewiredData__();return void 0===a[e]?_set_original__(e,t):a[e]=t}function _set_original__(e,t){switch(e){case"merchantId":return merchantId=t;case"renderMode":return renderMode=t;case"hostedfieldsurl":return hostedfieldsurl=t;case"fields":return fields=t;case"service":return service=t;case"styles":return styles=t;case"callback":return callback=t;case"onLoadCallback":return onLoadCallback=t;case"onCardBrandChangeCallback":return onCardBrandChangeCallback=t;case"onRequestIframeExpandCallback":return onRequestIframeExpandCallback=t;case"onCancelIframeExpandCallback":return onCancelIframeExpandCallback=t;case"onClickToPayCheckoutSuccessCallback":return onClickToPayCheckoutSuccessCallback=t;case"onClickToPayCheckoutErrorCallback":return onClickToPayCheckoutErrorCallback=t;case"autoFocusNext":return autoFocusNext=t;case"el":return el=t;case"clickToPayConfig":return clickToPayConfig=t;case"clickToPayAttributes":return clickToPayAttributes=t;case"targets":return targets=t;case"clickToPayIframe":return clickToPayIframe=t;case"responses":return responses=t;case"onLoadCounter":return onLoadCounter=t}}function _update_operation__(e,t,a){var r=_get__(t),e="++"===e?r+1:r-1;return _assign__(t,e),a?e:r}function _set__(t,e){var a=_getRewiredData__();return"object"===_typeof(t)?(Object.keys(t).forEach(function(e){a[e]=t[e]}),function(){Object.keys(t).forEach(function(e){_reset__(t)})}):(a[t]=void 0===e?INTENTIONAL_UNDEFINED:e,function(){_reset__(t)})}function _reset__(e){var t=_getRewiredData__();delete t[e],0==Object.keys(t).length&&delete _getRewireRegistry__()[_getRewireModuleId__]}function _with__(t){var a=_getRewiredData__(),r=Object.keys(t),n={};function _(){r.forEach(function(e){a[e]=n[e]})}return function(e){r.forEach(function(e){n[e]=a[e],a[e]=t[e]});e=e();return e&&"function"==typeof e.then?e.then(_).catch(_):_(),e}}(()=>{function e(e,t){Object.defineProperty(_RewireAPI__,e,{value:t,enumerable:!1,configurable:!0})}e("__get__",_get__),e("__GetDependency__",_get__),e("__Rewire__",_set__),e("__set__",_set__),e("__reset__",_reset__),e("__ResetDependency__",_reset__),e("__with__",_with__)})();var _default=exports.default=_RewireAPI__; \ No newline at end of file +var merchantId,renderMode,fields,hostedfieldsurl,service,styles,_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault"),_typeof=require("@babel/runtime/helpers/typeof"),_defineProperty2=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.HostedFields=void 0,exports.__ResetDependency__=_reset__,exports.__RewireAPI__=void 0,exports.__set__=exports.__Rewire__=_set__,exports.__GetDependency__=exports.__get__=_get__,exports.default=void 0,_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"))),_objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")),_toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")),_actions=require("./actions"),_excluded=["errors"],_excluded2=["errors"];function ownKeys(t,e){var a,r=Object.keys(t);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(t),e&&(a=a.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,a)),r}function _objectSpread(t){for(var e=1;e{var e=_getGlobalObject();e.__rewire_reset_all__||(e.__rewire_reset_all__=function(){e.__$$GLOBAL_REWIRE_REGISTRY__=Object.create(null)})})();var INTENTIONAL_UNDEFINED="__INTENTIONAL_UNDEFINED__",_RewireAPI__=exports.__RewireAPI__={};function _get__(e){var t=_getRewiredData__();return void 0===t[e]?_get_original__(e):(t=t[e])!==INTENTIONAL_UNDEFINED?t:void 0}function _get_original__(e){switch(e){case"merchantId":return merchantId;case"renderMode":return renderMode;case"hostedfieldsurl":return hostedfieldsurl;case"fields":return fields;case"service":return service;case"styles":return styles;case"callback":return callback;case"onLoadCallback":return onLoadCallback;case"onCardBrandChangeCallback":return onCardBrandChangeCallback;case"onRequestIframeExpandCallback":return onRequestIframeExpandCallback;case"onCancelIframeExpandCallback":return onCancelIframeExpandCallback;case"onClickToPayCheckoutSuccessCallback":return onClickToPayCheckoutSuccessCallback;case"onClickToPayCheckoutErrorCallback":return onClickToPayCheckoutErrorCallback;case"autoFocusNext":return autoFocusNext;case"el":return el;case"clickToPayConfig":return clickToPayConfig;case"clickToPayAttributes":return clickToPayAttributes;case"allowedOrigins":return allowedOrigins;case"extractOrigin":return extractOrigin;case"registerSingleIframe":return registerSingleIframe;case"registerIframes":return registerIframes;case"targets":return targets;case"actions":return _actions.actions;case"clickToPayIframe":return clickToPayIframe;case"assertClickToPayIsSet":return assertClickToPayIsSet;case"initIframe":return initIframe;case"initSingleIframe":return initSingleIframe;case"validateOrigin":return validateOrigin;case"responses":return responses;case"sendCallback":return sendCallback;case"recommendedExpandedHeight":return recommendedExpandedHeight;case"get":return get;case"iframeAllowPermissions":return iframeAllowPermissions;case"createIframeProxy":return createIframeProxy;case"handleOnLoad":return handleOnLoad;case"window":return window;case"eventHandler":return eventHandler;case"onLoadCounter":return onLoadCounter;case"createSingleIframeProxy":return createSingleIframeProxy;case"setup":return setup;case"reset":return reset;case"setClickToPayTransactionAmount":return setClickToPayTransactionAmount;case"clickToPayCheckout":return clickToPayCheckout}}function _assign__(e,t){var a=_getRewiredData__();return void 0===a[e]?_set_original__(e,t):a[e]=t}function _set_original__(e,t){switch(e){case"merchantId":return merchantId=t;case"renderMode":return renderMode=t;case"hostedfieldsurl":return hostedfieldsurl=t;case"fields":return fields=t;case"service":return service=t;case"styles":return styles=t;case"callback":return callback=t;case"onLoadCallback":return onLoadCallback=t;case"onCardBrandChangeCallback":return onCardBrandChangeCallback=t;case"onRequestIframeExpandCallback":return onRequestIframeExpandCallback=t;case"onCancelIframeExpandCallback":return onCancelIframeExpandCallback=t;case"onClickToPayCheckoutSuccessCallback":return onClickToPayCheckoutSuccessCallback=t;case"onClickToPayCheckoutErrorCallback":return onClickToPayCheckoutErrorCallback=t;case"autoFocusNext":return autoFocusNext=t;case"el":return el=t;case"clickToPayConfig":return clickToPayConfig=t;case"clickToPayAttributes":return clickToPayAttributes=t;case"allowedOrigins":return allowedOrigins=t;case"targets":return targets=t;case"clickToPayIframe":return clickToPayIframe=t;case"responses":return responses=t;case"onLoadCounter":return onLoadCounter=t}}function _update_operation__(e,t,a){var r=_get__(t),e="++"===e?r+1:r-1;return _assign__(t,e),a?e:r}function _set__(t,e){var a=_getRewiredData__();return"object"===_typeof(t)?(Object.keys(t).forEach(function(e){a[e]=t[e]}),function(){Object.keys(t).forEach(function(e){_reset__(t)})}):(a[t]=void 0===e?INTENTIONAL_UNDEFINED:e,function(){_reset__(t)})}function _reset__(e){var t=_getRewiredData__();delete t[e],0==Object.keys(t).length&&delete _getRewireRegistry__()[_getRewireModuleId__]}function _with__(t){var a=_getRewiredData__(),r=Object.keys(t),n={};function _(){r.forEach(function(e){a[e]=n[e]})}return function(e){r.forEach(function(e){n[e]=a[e],a[e]=t[e]});e=e();return e&&"function"==typeof e.then?e.then(_).catch(_):_(),e}}(()=>{function e(e,t){Object.defineProperty(_RewireAPI__,e,{value:t,enumerable:!1,configurable:!0})}e("__get__",_get__),e("__GetDependency__",_get__),e("__Rewire__",_set__),e("__set__",_set__),e("__reset__",_reset__),e("__ResetDependency__",_reset__),e("__with__",_with__)})();var _default=exports.default=_RewireAPI__; \ No newline at end of file diff --git a/src/sdk/api/index.js b/src/sdk/api/index.js index 8648580..d9c7654 100644 --- a/src/sdk/api/index.js +++ b/src/sdk/api/index.js @@ -41,8 +41,10 @@ var onClickToPayCheckoutErrorCallback; var autoFocusNext; // Keep track of number of loaded fields var onLoadCounter = 0; +// Allowed postMessage origins +var allowedOrigins = []; // This window. -var window = document.parentWindow || document.defaultView; +var window = document.parentWindow || document.defaultView; /** * ClickToPay attributes for the ClickToPay instance * @param locale default: "en_US" @@ -56,6 +58,16 @@ var clickToPayConfig; const recommendedExpandedHeight = 850; // in px const iframeAllowPermissions = 'payment'; +function extractOrigin (url) { + try { + var anchor = document.createElement('a') + anchor.href = url + return anchor.protocol + '//' + anchor.host + } catch (error) { + return null + } +} + function setup (config) { merchantId = config.merchantId; renderMode = config.renderMode; @@ -74,6 +86,12 @@ function setup (config) { el = config.el; clickToPayConfig = config.clickToPayConfig; clickToPayAttributes = config.clickToPayAttributes; + allowedOrigins = []; + + var hostedFieldsOrigin = extractOrigin(hostedfieldsurl) + if (hostedFieldsOrigin) { + allowedOrigins.push(hostedFieldsOrigin) + } // Create a single iframe for all the fields (single) or create an iframe per field (multiple) if (renderMode && renderMode === 'single') { @@ -86,12 +104,11 @@ function setup (config) { } function validateOrigin (origin) { - const validOrigins = [ - origin, + const fallbackOrigins = [ 'https://test-hostedpages.paymentiq.io', - 'https://hostedpages.paymentiq.io', 'https://card-fields.paymentiq.io' ] + const validOrigins = [...allowedOrigins, ...fallbackOrigins] return validOrigins.indexOf(origin) > -1 } From 7b573496afb99f72b22dd745ae560e1ff7220a79 Mon Sep 17 00:00:00 2001 From: Melinda Sava Date: Wed, 25 Mar 2026 09:37:42 +0100 Subject: [PATCH 2/4] Bump version and remove hostedpages support --- CHANGES.md | 10 +++++++--- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 286adc3..05d9259 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +### 1.3.1 +- Remove hostedpages domain support +- Update readme + #### 1.3.0 - Add ClickToPay integration support - Provide high-level types with index.d.ts ([Issue 21](https://github.com/devcode-git/hosted-fields-sdk/issues/21)) @@ -59,7 +63,7 @@ the onLoadCallback never to be triggered. - Reset shouldn't be an action, it should only be a method that the parent-application can call #### 1.0.7 -- Added reset() as a method to HostedFields. Resets the targets to an empty array. Necessary to run before running a new setupContent to avoid duplicates. +- Added reset() as a method to HostedFields. Resets the targets to an empty array. Necessary to run before running a new setupContent to avoid duplicates #### 1.0.6 - Updated readme @@ -78,7 +82,7 @@ the onLoadCallback never to be triggered. #### 1.0.1 - Using 2.6.0 of uglify-js since earlier versions had a security-gap -- Docs showing test-environment for hosted-fields. +- Docs showing test-environment for hosted-fields #### 1.0.0 -- initial commit, basic features for generating fields. +- initial commit, basic features for generating fields diff --git a/package-lock.json b/package-lock.json index 77922c9..e71cb92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "hosted-fields-sdk", - "version": "1.3.0", + "version": "1.3.1", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index dde3ded..b9eb258 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hosted-fields-sdk", - "version": "1.3.0", + "version": "1.3.1", "description": "Hosted fields sdk", "main": "dist/index.js", "types": "index.d.ts", From a532d2ea7a323a775fdf41661c576d748a8108ee Mon Sep 17 00:00:00 2001 From: Melinda Sava Date: Wed, 25 Mar 2026 10:32:31 +0100 Subject: [PATCH 3/4] Publish beta now --- .github/workflows/build_and_publish.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build_and_publish.yaml b/.github/workflows/build_and_publish.yaml index 234eb14..5c918eb 100644 --- a/.github/workflows/build_and_publish.yaml +++ b/.github/workflows/build_and_publish.yaml @@ -28,6 +28,11 @@ jobs: - name: Build the project run: npm run build + - name: Publish Beta to npm + run: npm publish --tag beta + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish to npm if: github.event_name == 'push' && github.ref == 'refs/heads/master' run: npm publish From 88dd03278852fafcc0888be67426751184a76589 Mon Sep 17 00:00:00 2001 From: Melinda Sava Date: Wed, 25 Mar 2026 12:35:20 +0100 Subject: [PATCH 4/4] Remove beta publish and only publish --- .github/workflows/build_and_publish.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build_and_publish.yaml b/.github/workflows/build_and_publish.yaml index 5c918eb..234eb14 100644 --- a/.github/workflows/build_and_publish.yaml +++ b/.github/workflows/build_and_publish.yaml @@ -28,11 +28,6 @@ jobs: - name: Build the project run: npm run build - - name: Publish Beta to npm - run: npm publish --tag beta - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Publish to npm if: github.event_name == 'push' && github.ref == 'refs/heads/master' run: npm publish