PluginProbe ʕ •ᴥ•ʔ
Worldline Global Online Pay for WooCommerce / 2.5.22
Worldline Global Online Pay for WooCommerce v2.5.22
2.5.22 2.5.20 2.5.17 trunk 1.0.0 1.0.1 2.0.0 2.1.0 2.2.0 2.3.0 2.4.0 2.4.1 2.4.2 2.4.4 2.4.5 2.4.6 2.5.1 2.5.10 2.5.11 2.5.12 2.5.14 2.5.16 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9
worldline-for-woocommerce / assets / hosted-tokenization-gateway-frontend-blocks.js
worldline-for-woocommerce / assets Last commit date
admin-actions-frontend-main-rtl.css 1 week ago admin-actions-frontend-main.asset.php 1 week ago admin-actions-frontend-main.css 1 week ago admin-actions-frontend-main.js 1 week ago checkout-frontend-main-rtl.css 1 week ago checkout-frontend-main.asset.php 1 week ago checkout-frontend-main.css 1 week ago checkout-frontend-main.js 1 week ago config-backend-main-rtl.css 1 week ago config-backend-main.asset.php 1 week ago config-backend-main.css 1 week ago config-backend-main.js 1 week ago hosted-tokenization-gateway-frontend-blocks.asset.php 1 week ago hosted-tokenization-gateway-frontend-blocks.js 1 week ago hosted-tokenization-gateway-frontend-main.asset.php 1 week ago hosted-tokenization-gateway-frontend-main.js 1 week ago return-page-frontend-main-rtl.css 1 week ago return-page-frontend-main.asset.php 1 week ago return-page-frontend-main.css 1 week ago return-page-frontend-main.js 1 week ago uninstall-backend-main.asset.php 1 week ago uninstall-backend-main.js 1 week ago worldline-payment-gateway-backend-main-rtl.css 1 week ago worldline-payment-gateway-backend-main.asset.php 1 week ago worldline-payment-gateway-backend-main.css 1 week ago worldline-payment-gateway-backend-main.js 1 week ago
hosted-tokenization-gateway-frontend-blocks.js
8 lines
1 !function(){"use strict";var e={431:function(e){e.exports=function(e,t,r,n){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var o=isFinite(+e)?+e:0,c=isFinite(+t)?Math.abs(t):0,i=void 0===n?",":n,a=void 0===r?".":r,s="";return s=(c?function(e,t){if(-1===(""+e).indexOf("e"))return+(Math.round(e+"e+"+t)+"e-"+t);var r=(""+e).split("e"),n="";return+r[1]+t>0&&(n="+"),(+(Math.round(+r[0]+"e"+n+(+r[1]+t))+"e-"+t)).toFixed(t)}(o,c).toString():""+Math.round(o)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,i)),(s[1]||"").length<c&&(s[1]=s[1]||"",s[1]+=new Array(c-s[1].length+1).join("0")),s.join(a)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var c=t[n]={exports:{}};return e[n](c,c.exports,r),c.exports}function n(e,t,r,n,o,c,i){try{var a=e[c](i),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var c=window.regeneratorRuntime,i=r.n(c),a=window.React,s=window.wp.element,u=window.wp.htmlEntities,l=window.wp.i18n,p=r(431),f=r.n(p);var m=window.wp.deprecated,d=r.n(m);const h=function(e){let t;function r(e){if(e.priceFormat)return function(e){const t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}(e.priceFormat.toString());switch(e.symbolPosition){case"left":return"%1$s%2$s";case"right":return"%2$s%1$s";case"left_space":return"%1$s %2$s";case"right_space":return"%2$s %1$s"}return"%1$s%2$s"}function n(e){const n={code:"USD",symbol:"$",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2,...e};let o=n.precision;null===o?(console.warn("Currency precision is null"),o=NaN):"string"==typeof o&&(o=parseInt(o,10)),t={code:n.code.toString(),symbol:n.symbol.toString(),symbolPosition:n.symbolPosition.toString(),decimalSeparator:n.decimalSeparator.toString(),priceFormat:r(n),thousandSeparator:n.thousandSeparator.toString(),precision:o}}function o(e,r=!1){const n=function({precision:e=null,decimalSeparator:t=".",thousandSeparator:r=","},n){if(void 0===n)return"";if("number"!=typeof n&&(n=parseFloat(n)),isNaN(n))return"";let o=null===e?NaN:Number(e);if(isNaN(o)){const[,e]=n.toString().split(".");o=e?e.length:0}return f()(n,o,t,r)}(t,e);if(""===n)return n;const{priceFormat:o,symbol:c,code:i}=t;return(0,l.sprintf)(o,r?i:c,n)}return n(e),{getCurrencyConfig:()=>({...t}),getDataForCountry:function(e,t={},r={}){const n=t[e];if(!n)return{};const o=r[n.currency_code];return o?{code:n.currency_code,symbol:(0,u.decodeEntities)(o),symbolPosition:n.currency_pos,thousandSeparator:n.thousand_sep,decimalSeparator:n.decimal_sep,precision:n.num_decimals}:{}},setCurrency:n,formatAmount:o,formatCurrency:function(e){return d()("Currency().formatCurrency",{version:"5.0.0",alternative:"Currency().formatAmount",plugin:"WooCommerce",hint:"`formatAmount` accepts the same arguments as formatCurrency"}),o(e)},getPriceFormat:r,formatDecimal(e){if("number"!=typeof e&&(e=parseFloat(e)),Number.isNaN(e))return 0;const{precision:r}=t;return Math.round(e*Math.pow(10,r))/Math.pow(10,r)},formatDecimalString(e){if("number"!=typeof e&&(e=parseFloat(e)),Number.isNaN(e))return"";const{precision:r}=t;return e.toFixed(r)},render(e){return"number"!=typeof e&&(e=parseFloat(e)),e<0?(0,s.createElement)("span",{className:"is-negative"},o(e)):o(e)}}};function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function w(e,t,r){return(t=function(e){var t=function(e){if("object"!=y(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==y(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(r,!0).forEach((function(t){w(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}window.wp.hooks;var v={adminUrl:"",countries:[],currency:{code:"USD",precision:2,symbol:"$",symbolPosition:"left",decimalSeparator:".",priceFormat:"%1$s%2$s",thousandSeparator:","},defaultDateRange:"period=month&compare=previous_year",locale:{siteLocale:"en_US",userLocale:"en_US",weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},orderStatuses:[],siteTitle:"",wcAssetUrl:""},S=b({},v,{},"object"===("undefined"==typeof wcSharedSettings?"undefined":y(wcSharedSettings))?wcSharedSettings:{});S.currency=b({},v.currency,{},S.currency),S.locale=b({},v.locale,{},S.locale),S.adminUrl,S.countries,S.currency,S.locale,S.orderStatuses,S.siteTitle,S.wcAssetUrl,S.defaultDateRange;const j=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return S.hasOwnProperty(e)?S[e]:t}("currency"),_=h(j);(0,s.createContext)(_);var O=h,k=window.wp.data;function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){w(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var P="wlop-ht-surcharge",N={surcharge:0},E=(0,k.createReduxStore)(P,{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N,t=arguments.length>1?arguments[1]:void 0;return"SET_SURCHARGE"===t.type?C(C({},e),{},{surcharge:t.payload}):e},actions:{setSurcharge:function(e){return{type:"SET_SURCHARGE",payload:e}}},selectors:{getSurcharge:function(e){return e.surcharge}}});(0,k.register)(E);var F=window.ReactJSXRuntime;addEventListener("DOMContentLoaded",(function(){var e=function(e){var r,c,s=e.eventRegistration,u=e.emitResponse,l=e.billing,p=e.token,f=s.onPaymentSetup,m=u.responseTypes,d=(0,k.useSelect)((function(e){return e(P).getSurcharge()}),[]),h=(0,k.useDispatch)(P).setSurcharge,y=(r=(0,a.useState)(!1),c=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,c,i,a=[],s=!0,u=!1;try{if(c=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=c.call(r)).done)&&(a.push(n.value),a.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return a}}(r,c)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(r,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=y[0],g=y[1],b=(0,a.useRef)(null);return(0,a.useEffect)((function(){g(!1);var e={hideCardholderName:!1,hideTokenFields:!1};return WlopHtConfig.surcharge&&(e.surchargeCallback=function(e){if(e.surcharge.success){var t=e.surcharge.result.surchargeAmount.amount;if(!Number.isInteger(t))return void console.error("Invalid surcharge amount received. "+t);h(t)}else console.error(e.surcharge.error)}),b.current=new Tokenizer(WlopHtConfig.url,WlopHtConfig.wrapper.id,e),b.current.initialize().then((function(){return g(!0)})),function(){try{g(!1),b.current.destroy()}catch(e){}}}),[]),(0,a.useEffect)((function(){var e=l.cartTotal.value/Math.pow(10,l.currency.minorUnit),t=Math.round(e*WlopHtConfig.currency.centFactor);b.current.setAmount(t,l.currency.code)}),[l.cartTotal.value,l.currency.code,l.currency.minorUnit]),(0,a.useEffect)((function(){if(w)if(p){var e=WlopHtConfig.tokens[p];b.current.useToken(e)}else b.current.useToken()}),[p,w]),(0,a.useEffect)((function(){return f((function(){function e(){var t;return t=i().mark((function e(){var t,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.current.submitTokenization();case 2:if((t=e.sent).success){e.next=5;break}return e.abrupt("return",{type:m.ERROR,message:t.error.message});case 5:return r=t.hostedTokenizationId,e.abrupt("return",{type:m.SUCCESS,meta:{paymentMethodData:{wlop_hosted_tokenization_id:r,wlop_screen_height:window.screen.height.toString(),wlop_screen_width:window.screen.width.toString(),wlop_color_depth:window.screen.colorDepth.toString(),wlop_java_enabled:navigator.javaEnabled().toString(),wlop_timezone_offset:(new Date).getTimezoneOffset().toString()}}});case 7:case"end":return e.stop()}}),e)})),e=function(){var e=this,r=arguments;return new Promise((function(o,c){var i=t.apply(e,r);function a(e){n(i,o,c,a,s,"next",e)}function s(e){n(i,o,c,a,s,"throw",e)}a(void 0)}))},e.apply(this,arguments)}return function(){return e.apply(this,arguments)}()}))}),[f,m]),(0,a.useEffect)((function(){return function(){h(0)}}),[h]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{id:WlopHtConfig.wrapper.id,className:"wlop-ht-wrapper"}),(0,F.jsx)(t,{surcharge:d})]})},t=function(e){var t=e.surcharge;if(t<=0)return null;var r=O(wcSettings.currency).formatAmount(t/WlopHtConfig.currency.centFactor);return(0,F.jsx)("div",{className:"wlop-surcharge-note",children:(0,l.sprintf)(
2 /**
3 * translators: %s the surcharge amount, like $0.23
4 */
5 /**
6 * translators: %s the surcharge amount, like $0.23
7 */
8 (0,l.__)("Includes surcharge of %s","worldline-for-woocommerce"),r)})};wp.hooks.addFilter(WlopHtConfig.gateway.id+"_checkout_fields","wlop/ht/checkout",(function(t){return t.push(e),t})),wp.hooks.addFilter(WlopHtConfig.gateway.id+"_saved_token_fields","wlop/ht/checkout",(function(t){return t.push(e),t}))})),addEventListener("DOMContentLoaded",(function(){var e,t;if("undefined"!=typeof wc&&null!==(e=wc.blocksCheckout)&&void 0!==e&&e.ExperimentalOrderMeta&&"undefined"!=typeof wp&&null!==(t=wp.plugins)&&void 0!==t&&t.registerPlugin){var r=wc.blocksCheckout.ExperimentalOrderMeta,n=wp.plugins.registerPlugin,o=function(e){var t=e.cart,r=(0,k.useSelect)((function(e){return e(P).getSurcharge()}),[]);if(null==t||!t.cartTotals||!r)return null;var n=parseFloat(t.cartTotals.total_price)+r,o=O(wcSettings.currency),c=o.formatAmount(r/WlopHtConfig.currency.centFactor),i=o.formatAmount(n/WlopHtConfig.currency.centFactor);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"wp-block-woocommerce-checkout-order-summary-fee-block wc-block-components-totals-wrapper",children:(0,F.jsxs)("div",{className:"wc-block-components-totals-item",children:[(0,F.jsx)("span",{className:"wc-block-components-totals-item__label",children:(0,l.__)("Surcharge","worldline-for-woocommerce")}),(0,F.jsx)("span",{className:"wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value",children:c}),(0,F.jsx)("div",{className:"wc-block-components-totals-item__description"})]})}),(0,F.jsx)("div",{className:"wc-block-components-totals-wrapper",children:(0,F.jsxs)("div",{className:"wc-block-components-totals-item wc-block-components-totals-footer-item",children:[(0,F.jsx)("span",{className:"wc-block-components-totals-item__label",children:(0,l.__)("Total With Surcharge","worldline-for-woocommerce")}),(0,F.jsx)("div",{className:"wc-block-components-totals-item__value",children:(0,F.jsx)("span",{className:"wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-footer-item-tax-value",children:i})}),(0,F.jsx)("div",{className:"wc-block-components-totals-item__description"})]})})]})};n("wlop-ht-surcharge-summary",{scope:"woocommerce-checkout",render:function(){return(0,F.jsx)(r,{children:(0,F.jsx)(o,{})})}})}}))}();