UNPKG

@adyen/adyen-web

Version:

[![npm](https://img.shields.io/npm/v/@adyen/adyen-web.svg)](https://www.npmjs.com/package/@adyen/adyen-web)

3 lines (2 loc) 1.35 kB
import{getCardGroupTypes as i}from"../utils/getCardGroupTypes.js";import{NON_CREDIT_CARD_TYPE_SECURED_FIELDS as o,SF_VERSION as t}from"../../constants.js";import{warn as n}from"../../utilities/logger.js";function e(e){this.config.cardGroupTypes=i(e.cardGroupTypes);const r=e.loadingContext;if(!r)return void n("WARNING Config :: no loadingContext has been specified!");var s;this.config.loadingContext="/"===(s=r).charAt(s.length-1)?r:`${r}/`,this.config.isCreditCardType=!1===o.includes(e.type),this.config.iframeUIConfig=e.iframeUIConfig??{},this.config.autoFocus=!(!1===e.autoFocus||"false"===e.autoFocus),this.config.showWarnings=!0===e.showWarnings||"true"===e.showWarnings,this.config.trimTrailingSeparator=!(!1===e.trimTrailingSeparator||"false"===e.trimTrailingSeparator),this.config.keypadFix=!(!1===e.keypadFix||"false"===e.keypadFix),this.config.legacyInputMode=e.legacyInputMode||null,this.config.minimumExpiryDate=e.minimumExpiryDate||null,this.config.sfLogAtStart=!0===window._b$dl;const a=this.config.isCreditCardType?"card":e.type,c=btoa(window.location.origin),g=`${a}${!this.config.loadingContext.includes("live")&&e.forceCompat?"Compat":""}`;this.config.iframeSrc=`${this.config.loadingContext}securedfields/${e.clientKey}/${t}/securedFields.html?type=${g}&d=${c}`}export{e as handleConfig}; //# sourceMappingURL=handleConfig.js.map