diff --git a/build/index.asset.php b/build/index.asset.php new file mode 100644 index 0000000..b8b5579 --- /dev/null +++ b/build/index.asset.php @@ -0,0 +1 @@ + array('@woocommerce/blocks-registry', 'react', 'wp-element', 'wp-polyfill'), 'version' => 'b53687c38b284a0c8c13'); diff --git a/build/index.css b/build/index.css new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/build/index.css @@ -0,0 +1 @@ + diff --git a/build/index.js b/build/index.js new file mode 100644 index 0000000..8552c0d --- /dev/null +++ b/build/index.js @@ -0,0 +1 @@ +!function(){"use strict";var e=window.wp.element,n=window.React,o=function({paymentMethodConfigurationId:o,eventRegistration:t}){const{onCheckoutSuccess:i,onCheckoutFail:a,onCheckoutValidation:c,onPaymentProcessing:r,onPaymentSetup:s}=t,[l,u]=(0,n.useState)(!0),d=`payment-method-${o}`;let m=window.IframeCheckoutHandler(o);const g=(0,n.useCallback)((()=>{m.create(d),u(!1)}),[o,d]);return(0,n.useEffect)((()=>{document.getElementById(d)&&g();const e=i((()=>(console.log("onCheckoutSuccess"),new Promise((e=>{console.log("Running submit"),m.submit(),setTimeout((function(){e(!1)}),3e4)}))))),n=c((()=>{console.log("onCheckoutValidation");let e=new Promise((e=>{m.setValidationCallback((n=>{console.log("Validation was ",n),void 0!==n.success?e(n.success):(console.error("Validation result did not return a success status."),e(!1))}))}));return m.validate(),e})),o=a((()=>{console.log("onCheckoutFail")})),t=r((()=>{console.log("onPaymentProcessing")})),l=s((()=>{console.log("onPaymentSetup")}));return()=>{e(),o(),n(),t(),l()}}),[g,d,i,a,c,r,s]),(0,e.createElement)("div",null,l&&(0,e.createElement)("div",null,"Loading payment method..."),(0,e.createElement)("div",{id:d}))},t=function({paymentMethodConfigurationId:e,eventRegistration:o}){console.log("LightboxComponent");const{onCheckoutSuccess:t,onCheckoutValidationBeforeProcessing:i,onCheckoutError:a}=o,[c,r]=(0,n.useState)(!0);(0,n.useEffect)((()=>{const n=t((()=>new Promise(((n,o)=>{console.log("onCheckoutSuccess"),window.LightboxCheckoutHandler.startPayment(e,(function(e,t){!e||e.error?o(e):n(e)}))})).then((e=>{console.log("Payment process finished",e)})).catch((e=>{alert("An error occurred during the initialization of the payment lightbox."),console.error(e)}))));return()=>{n()}}),[t,e])},i=window.wc.wcBlocksRegistry;jQuery((function(n){const a=wp.apiFetch.nonceEndpoint;n.post(a,{action:"get_payment_methods"},(function(c){c.map((function(c){let r;r="iframe"===c.integration_mode?(0,e.createElement)(o,{paymentMethodConfigurationId:c.configuration_id}):(0,e.createElement)(t,{paymentMethodConfigurationId:c.configuration_id});let s={name:c.name,label:c.label,content:r,edit:(0,e.createElement)("div",null,c.description),ariaLabel:c.ariaLabel,canMakePayment:async e=>await async function(){try{return new Promise(((e,o)=>{n.post(a,{action:"is_payment_method_available",payment_method:c.name,configuration_id:c.configuration_id},(function(n){e(n)})).fail((function(e){console.error("Error:",e),o(!1)}))}))}catch(e){return console.error("Error:",e),!1}}()};(0,i.registerPaymentMethod)(s)}))})).fail((function(e){console.error("Error getting payment methods. ",e)}))}))}(); \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index 235251e..60fc22b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -449,7 +449,7 @@ Features: - Support of Wordpress 6.1 - Support of Woocommerce 7.0.1 Bugfixes: -- Fix that when 0 manual task are needed, the message ?0 manuelle Tasks ben?tigen Ihre Aufmerksamkeit? is shown. +- Fix that when 0 manual task are needed, the message ‘0 manuelle Tasks benötigen Ihre Aufmerksamkeit’ is shown. Tested against: - PHP 7.4.32 - Wordpress: 6.1 diff --git a/docs/en/documentation.html b/docs/en/documentation.html index ccf583e..ed7a114 100644 --- a/docs/en/documentation.html +++ b/docs/en/documentation.html @@ -5,7 +5,7 @@ - + PostFinance Checkout WooCommerce