pay.datatrans.com
Open in
urlscan Pro
193.16.220.35
Public Scan
Submitted URL: http://pay.datatrans.com/upp/payment/js/secure-fields-2.0.0.min.js
Effective URL: https://pay.datatrans.com/upp/payment/js/secure-fields-2.0.0.min.js
Submission: On December 27 via manual from US — Scanned from CH
Effective URL: https://pay.datatrans.com/upp/payment/js/secure-fields-2.0.0.min.js
Submission: On December 27 via manual from US — Scanned from CH
Form analysis
0 forms found in the DOMText Content
(function(a,b){if(typeof define==="function"&&define.amd){define([],b)}else{if(typeof module==="object"&&module.exports){module.exports=b()}else{a.SecureFields=b()}}}(typeof self!=="undefined"?self:this,function(){return function(E){var C={};var B=h();var H={};var y={TOKENIZE:"TOKENIZE",PAY:"PAY",REGISTER:"REGISTER"};var d="/upp/payment/SecureFields",e,s,g,f,p,c,A,G,q,z,w;function D(){e={};s={};g=[];p=false;G="";w=null;f=null;H={};z=false}D();function l(){if(window.console&&e.debug){var I=Array.prototype.slice.call(arguments).map(function(J){return(typeof J==="object")?JSON.stringify(J,null,"\t"):J});I.splice(1,0,"color: blue");I[0]="%c"+I[0];console.log.apply(console,I)}}function h(){return Math.random().toString(36).substr(2,9)}function m(I){return"securefields-"+B+"--"+I}C.initTokenize=function(K,J,I){q=y.TOKENIZE;n(K,null,J,I)};C.initPay=function(K,J,I){q=y.PAY;n(K,null,J,I)};C.initRegister=function(K,J,I){q=y.REGISTER;n(K,null,J,I)};C.init=function(K,J,I){n(null,K,J,I)};function n(M,O,K,I){D();c=M;A=O;e=I||{};for(var P in K){if(!K.hasOwnProperty(P)){continue}if(P==="copyToClipboard"){for(var J in K.copyToClipboard){if(!K.copyToClipboard.hasOwnProperty(J)){continue}var L=K.copyToClipboard[J];var N;if(typeof L==="object"){N=L.placeholderElementId}else{N=L}var P="copyToClipboard."+J;s[P]={fieldName:P,placeholderElementId:N,copyToClipboardTargetFieldName:J,copyToClipboardLabel:L.label,ariaLabel:L.ariaLabel,inputType:"button",iframeTitle:L.iframeTitle,alive:false};g.push(P)}continue}var L=K[P];var N;if(typeof L==="object"){N=L.placeholderElementId}else{N=L}s[P]={fieldName:P,placeholderElementId:N,placeholder:L.placeholder,ariaLabel:L.ariaLabel,inputType:L.inputType,iframeTitle:L.iframeTitle,alive:false};g.push(P)}g.sort(function(R,Q){if(R==="cardNumber"){return -1}else{if(Q==="cardNumber"){return 1}else{return R.localeCompare(Q)}}});if(Object.prototype.toString.call(e.paymentMethods)===Object.prototype.toString.call([])&&e.paymentMethods.length>0){w=e.paymentMethods.join(",")}l("Initializing iframes for merchantId/transactionId %s/%s",c,A,s,e);f=g[0];b(s[f])}function b(M){var N=document.getElementById(M.placeholderElementId);var L={mode:q,merchantId:c,transactionId:A,fieldName:M.fieldName,formId:G,placeholder:M.placeholder,ariaLabel:M.ariaLabel,inputType:M.inputType,debug:e.debug,countryCode:e.countryCode,version:datatransPaymentConfig.version,paymentMethods:w,fieldNames:g.join(","),instanceId:B,copyToClipboardTargetFieldName:M.copyToClipboardTargetFieldName,copyToClipboardLabel:M.copyToClipboardLabel};var I=m(M.fieldName);var J={id:I,name:I,src:datatransPaymentConfig.endpoint+d+"/paymentField?"+k(L),sandbox:"allow-scripts allow-same-origin allow-forms allow-popups",frameborder:"0",scrolling:"no","class":I,title:M.iframeTitle};if(M.fieldName.match(/^copyToClipboard/g)){J.allow="clipboard-write"}if(M.fieldName==="applePay"||M.fieldName==="googlePay"){J.allow="payment"}var K=document.createElement("iframe");Object.keys(J).filter(function(O){return J[O]!==undefined}).forEach(function(O){K.setAttribute(O,J[O])});K.setAttribute("style","width: 100%; height: 100%");while(N.hasChildNodes()){N.removeChild(N.lastChild)}N.appendChild(K);l("Created iframe for field %s",M);M.iframe=K[0]}function j(){for(var I=1;I<g.length;I++){b(s[g[I]])}}function u(J){var I=document.getElementById(m(J.fieldName));if(I){I.parentNode.removeChild(I)}}function x(){for(var I=0;I<g.length;I++){u(s[g[I]])}}C.setStyle=function(R,P,M){var S=(typeof R==="object")?R:(function(){var T={};T[R]=P;return T})();for(var L in S){if(!S.hasOwnProperty(L)){continue}var I=S[L],N=[],O=new RegExp("(^("+g.join("|")+")|^\\*|:{1,2}[\\w-]([\\w-.]|\\(.*\\))+|\\.\\w+|^@media\\s.*|^@font-face)","gi"),J;while(J=O.exec(L)){N.push(J[1])}if(N.length>0&&(N[0].indexOf("@media")===0||N[0].indexOf("@font-face")===0)){C.setStyle(I,null,N[0]);continue}var K=N.shift();for(var Q in s){if(s.hasOwnProperty(Q)&&(K==="*"||K===Q)){window.frames[m(Q)].postMessage({messageType:"setStyle",selectors:N,style:I,globalSelector:M},"*")}}}};C.setPlaceholder=function(J,I){if(s.hasOwnProperty(J)){window.frames[m(J)].postMessage({messageType:"setPlaceholder",placeholder:I},"*")}};C.setAriaLabel=function(J,I){if(s.hasOwnProperty(J)){window.frames[m(J)].postMessage({messageType:"setAriaLabel",ariaLabel:I},"*")}};C.submit=function(I,J){v("submitRequest",{parameters:I,browserDetails:{browserUserAgent:navigator.userAgent,browserJavaEnabled:navigator.javaEnabled(),browserLanguage:navigator.language,browserColorDepth:screen.colorDepth,browserScreenHeight:screen.height,browserScreenWidth:screen.width,browserTZ:(new Date()).getTimezoneOffset()}},J)};C.validate=function(){l("Sending validate event");window.frames[m(f)].postMessage({messageType:"validateRequest"},"*")};C.getCardInfo=function(I){v("cardInfoRequest",{},I)};function v(J,K,L){if(L!==undefined&&L instanceof Function){var I=J+":"+h();H[I]=L;K.messageId=I}K.messageType=J;l(">>> %s\n%s",J,K);window.frames[m(f)].postMessage(K,"*")}C.focus=function(I){window.frames[m(I)].focus()};C.clear=function(I){window.frames[m(I)].postMessage({messageType:"clear"},"*")};function i(L){if(B!==L.data.instanceId){return}l("<<< (instance id: %s)\n\torigin: %s\n\tdata: %s",B,L.origin,L.data);if(datatransPaymentConfig.endpoint!==L.origin){l("message ignored. origin should be: %s",datatransPaymentConfig.endpoint);return}var I={fieldReady:function(N){if(!s[N.fieldName]){return}s[N.fieldName].alive=true;s[N.fieldName].details=N.details;if(N.fieldName===f){G=N.formId;j()}F()},initResponse:function(N){N.error.action="init";r("error",N.error)},submitResponse:function(P){var N=P.response;var Q=N.result==="success";var O=N.result==="dccNeeded";delete N.result;if(Q){r("success",P.response)}else{if(O){r("dccNeeded",P.response)}else{P.response.action="submit";r("error",P.response)}}},validateResponse:function(N){r("validate",N.response)},cardInfoResponse:function(N){r("cardInfo",N.response)},dccFieldsResponse:function(N){r("dccFields",N.response)},mcpResponse:function(N){r("mcp",N.response)},change:function(N){r("change",N.response)},copyToClipboard:function(N){r("copyToClipboard",N.response)},error:function(N){r("error",N.response)}};var J=L.data.messageId;var M=H[J];if(M!==undefined){delete H[J];M.apply(C,[L.data.response])}else{var K=I[L.data.messageType];if(K){K.apply(C,[L.data])}}}window.addEventListener("message",i,false);function F(){const I=Object.keys(s).reduce(function(J,K){J.ready=J.ready&&s[K].alive;if(s[K].details!==undefined&&Object.keys(s[K].details).length>0){J.details[K]=s[K].details}return J},{ready:true,details:{}});if(I.ready){l("All iframes are ready. Sending ready event.");if(typeof e.styles!=="undefined"){C.setStyle(e.styles)}if(typeof e.focus!=="undefined"){C.focus(e.focus)}if(Object.keys(I.details).length>0){r("ready",I.details)}else{r("ready")}o()}}function a(I){Object.keys(s).map(function(K){var J=window.frames[m(K)];if(typeof J!=="undefined"){J.postMessage({messageType:"checkFocus"},"*")}})}function o(){document.addEventListener("touchend",a,true)}var t={};C.on=function(J,I){t[J]=I};var r=function(){var I=Array.prototype.slice.call(arguments);var J=t[I.shift()];if(J){J.apply(null,I)}};function k(I){var J=Object.keys(I).filter(function(K){var L=I[K];return K&&typeof L!=="undefined"&&L!==null}).map(function(K){return K+"="+I[K]}).join("&");return encodeURI(J)}C.destroy=function(){window.removeEventListener("touchend",a,true);window.removeEventListener("message",i,false);x()};return C}})); var datatransPaymentConfig = {"endpoint":"https://pay.datatrans.com","version":"2.0.0"};