diff --git a/.github/workflows/soft-release.yml b/.github/workflows/soft-release.yml deleted file mode 100644 index 460fb89..0000000 --- a/.github/workflows/soft-release.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Soft Release Plugin -on: - push: - tags: - - '[0-9]+.[0-9]+.[0-9]+-beta*' - - '[0-9]+.[0-9]+.[0-9]+-rc*' - -jobs: - beta_release: - name: Soft Release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Pre-Release Notice - run: | - echo "Pre-release tag detected. Skipping full release steps. Only pre-release actions will be performed." diff --git a/.github/workflows/woo-publish.yml b/.github/workflows/woo-publish.yml index e0f6529..46e9088 100644 --- a/.github/workflows/woo-publish.yml +++ b/.github/workflows/woo-publish.yml @@ -2,11 +2,11 @@ name: Release Plugin on: push: tags: - - '[0-9]+.[0-9]+.[0-9]+' + - '*' jobs: tag: - name: Full Release + name: New release runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/README.md b/README.md index dbe76ec..c571fbc 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This repository contains the PostFinance Checkout plugin that enables WooCommerc ## Documentation -* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.2-beta/docs/en/documentation.html) +* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.2/docs/en/documentation.html) ## Support @@ -33,7 +33,7 @@ ____________________________________________________________________________ ## License -Please see the [license file](https://github.com/pfpayments/woocommerce/blob/3.3.2-beta/LICENSE) for more information. +Please see the [license file](https://github.com/pfpayments/woocommerce/blob/3.3.2/LICENSE) for more information. ## Privacy Policy diff --git a/assets/js/frontend/blocks/build/index.asset.php b/assets/js/frontend/blocks/build/index.asset.php index a958f0f..6002693 100644 --- a/assets/js/frontend/blocks/build/index.asset.php +++ b/assets/js/frontend/blocks/build/index.asset.php @@ -1 +1 @@ - array('@woocommerce/blocks-registry', 'react', 'wp-polyfill'), 'version' => '8de5d1b01ac08d3a2491'); + array('@woocommerce/blocks-registry', 'react', 'wp-polyfill'), 'version' => '7d280224628cd5ce269b'); diff --git a/assets/js/frontend/blocks/build/index.js b/assets/js/frontend/blocks/build/index.js index 189c67f..594f368 100644 --- a/assets/js/frontend/blocks/build/index.js +++ b/assets/js/frontend/blocks/build/index.js @@ -1 +1 @@ -(()=>{"use strict";const e=window.React,t=function({paymentMethodConfigurationId:t,eventRegistration:n}){const{onCheckoutSuccess:o,onCheckoutValidation:a}=n,[i,r]=(0,e.useState)(!0),c=`payment-method-${t}`;let l=window.IframeCheckoutHandler(t);const s=(0,e.useCallback)((()=>{l.create(c),r(!1)}),[t,c]);return(0,e.useEffect)((()=>{document.getElementById(c)&&s();const e=o((()=>new Promise((e=>{l.submit(),setTimeout((function(){e(!1)}),3e4)})))),t=a((()=>{let e=new Promise((e=>{l.setValidationCallback((t=>{void 0!==t.success?e(t.success):(console.error("Validation was not successful"),e(!1))}))}));return l.validate(),e}));return()=>{e(),t()}}),[s,c,o,a]),(0,e.createElement)("div",null,i&&(0,e.createElement)("div",null,"Loading payment method..."),(0,e.createElement)("div",{id:c}))},n=function({paymentMethodConfigurationId:t,eventRegistration:n}){const{onCheckoutSuccess:o}=n;(0,e.useEffect)((()=>{const e=o((()=>new Promise(((e,n)=>{window.LightboxCheckoutHandler.startPayment(t,(function(t,o){!t||t.error?n(t):e(t)}))})).catch((e=>{console.error(e),alert("An error occurred during the initialization of the payment lightbox.")}))));return()=>{e()}}),[o,t])};function o({label:t,src:n,alt:o,width:a}){return(0,e.createElement)("div",null," ",t," ",(0,e.createElement)("img",{src:n,alt:o,width:a})," ")}const a=window.wc.wcBlocksRegistry;(i=>{let r=null;const c=document.getElementById("postfinancecheckout-payment-methods")?.getAttribute("data-json");if(c)try{r=JSON.parse(c)}catch(e){console.error("Error parsing JSON found in HTML:",e)}const l=wp.apiFetch.nonceEndpoint,s=window.postfinancecheckout_block_params?.postfinancecheckout_nonce||"";if(null!=r)m(r),document.getElementById("postfinancecheckout-payment-methods").remove();else{if(""==s)return void console.warn("nonce value not found, we dont' do request to backend");i.post(l,{action:"get_payment_methods",postfinancecheckout_nonce:s},(function(e){m(e)})).fail((function(e,t,n){console.error("Error getting payment methods from backend. Check response body for details.")}))}function m(r){r.map((function(r){let c;c="iframe"===r.integration_mode?(0,e.createElement)(t,{paymentMethodConfigurationId:r.configuration_id}):(0,e.createElement)(n,{paymentMethodConfigurationId:r.configuration_id});let m=function(e){const t=e.match(/src="([^"]+)"/),n=e.match(/alt="([^"]*)"/),o=e.match(/width="([^"]+)"/);return{src:t?t[1]:"",alt:n?n[1]:"",width:o?o[1]:""}}(r.icon),u={name:r.name,label:(0,e.createElement)(o,{label:r.label,...m}),content:c,edit:(0,e.createElement)("div",null,r.description),ariaLabel:r.ariaLabel,supports:{features:r.supports},canMakePayment:async e=>{if("iframe"===r.integration_mode){let e=document.getElementById("paymentForm_"+r.configuration_id);e&&(e.src=e.src)}let t=(e=>{"paymentMethods"in e&&delete e.paymentMethods;const t=JSON.stringify(e);let n=0;for(let e=0;e{const t=sessionStorage.getItem(e);if(!t)return null;const n=JSON.parse(t);return(new Date).getTime()>n.expiry?(sessionStorage.removeItem(e),null):n.value})(n);return null!==o?o:await async function(){try{return new Promise(((e,t)=>{i.post(l,{action:"is_payment_method_available",payment_method:r.name,configuration_id:r.configuration_id,postfinancecheckout_nonce:s},(function(t){((e,t)=>{const n={value:t,expiry:(new Date).getTime()+36e5};sessionStorage.setItem(e,JSON.stringify(n))})(n,t),e(t)})).fail((function(e){console.error("Error:",e),t(!1)}))}))}catch(e){return console.error("Error:",e),!1}}()}};(0,a.registerPaymentMethod)(u)}))}})(jQuery)})(); \ No newline at end of file +(()=>{"use strict";const e=window.React,t=function({paymentMethodConfigurationId:t,eventRegistration:n}){const{onCheckoutSuccess:o,onCheckoutValidation:a}=n,[r,i]=(0,e.useState)(!0),c=`payment-method-${t}`;let l=window.IframeCheckoutHandler(t);const s=(0,e.useCallback)((()=>{l.create(c),i(!1)}),[t,c]);return(0,e.useEffect)((()=>{document.getElementById(c)&&s();const e=o((()=>new Promise((e=>{l.submit(),setTimeout((function(){e(!1)}),3e4)})))),t=a((()=>{let e=new Promise((e=>{l.setValidationCallback((t=>{void 0!==t.success?e(t.success):(console.error("Validation was not successful"),e(!1))}))}));return l.validate(),e}));return()=>{e(),t()}}),[s,c,o,a]),(0,e.createElement)("div",null,r&&(0,e.createElement)("div",null,"Loading payment method..."),(0,e.createElement)("div",{id:c}))},n=function({paymentMethodConfigurationId:t,eventRegistration:n}){const{onCheckoutSuccess:o}=n;(0,e.useEffect)((()=>{const e=o((()=>new Promise(((e,n)=>{window.LightboxCheckoutHandler.startPayment(t,(function(t,o){!t||t.error?n(t):e(t)}))})).catch((e=>{console.error(e),alert("An error occurred during the initialization of the payment lightbox.")}))));return()=>{e()}}),[o,t])};function o({label:t,src:n,alt:o,width:a}){return(0,e.createElement)("div",null," ",t," ",(0,e.createElement)("img",{src:n,alt:o,width:a})," ")}const a=window.wc.wcBlocksRegistry;(r=>{let i=null;const c=document.getElementById("whitelabel-payment-methods")?.getAttribute("data-json");if(c)try{i=JSON.parse(c)}catch(e){console.error("Error parsing JSON found in HTML:",e)}const l=wp.apiFetch.nonceEndpoint,s=window.postfinancecheckout_block_params?.postfinancecheckout_nonce||"";if(null!=i)m(i),document.getElementById("whitelabel-payment-methods").remove();else{if(""==s)return void console.warn("nonce value not found, we dont' do request to backend");r.post(l,{action:"get_payment_methods",postfinancecheckout_nonce:s},(function(e){m(e)})).fail((function(e,t,n){console.error("Error getting payment methods from backend. Check response body for details.")}))}function m(i){i.map((function(i){let c;c="iframe"===i.integration_mode?(0,e.createElement)(t,{paymentMethodConfigurationId:i.configuration_id}):(0,e.createElement)(n,{paymentMethodConfigurationId:i.configuration_id});let m=function(e){const t=e.match(/src="([^"]+)"/),n=e.match(/alt="([^"]*)"/),o=e.match(/width="([^"]+)"/);return{src:t?t[1]:"",alt:n?n[1]:"",width:o?o[1]:""}}(i.icon),u={name:i.name,label:(0,e.createElement)(o,{label:i.label,...m}),content:c,edit:(0,e.createElement)("div",null,i.description),ariaLabel:i.ariaLabel,supports:{features:i.supports},canMakePayment:async e=>{let t=(e=>{const t=JSON.stringify(e);let n=0;for(let e=0;e{const t=sessionStorage.getItem(e);if(!t)return null;const n=JSON.parse(t);return(new Date).getTime()>n.expiry?(sessionStorage.removeItem(e),null):n.value})(n);if("iframe"===i.integration_mode){let e=document.getElementById("paymentForm_"+i.configuration_id);e&&(e.src=e.src)}return null!==o?o:await async function(){try{return new Promise(((e,t)=>{r.post(l,{action:"is_payment_method_available",payment_method:i.name,configuration_id:i.configuration_id,postfinancecheckout_nonce:s},(function(t){((e,t)=>{const n={value:t,expiry:(new Date).getTime()+36e5};sessionStorage.setItem(e,JSON.stringify(n))})(n,t),e(t)})).fail((function(e){console.error("Error:",e),t(!1)}))}))}catch(e){return console.error("Error:",e),!1}}()}};(0,a.registerPaymentMethod)(u)}))}})(jQuery)})(); \ No newline at end of file diff --git a/docs/en/documentation.html b/docs/en/documentation.html index 7379b16..f9de942 100644 --- a/docs/en/documentation.html +++ b/docs/en/documentation.html @@ -23,7 +23,7 @@

Documentation

  • - + Source
  • diff --git a/includes/admin/class-wc-postfinancecheckout-admin-settings-page.php b/includes/admin/class-wc-postfinancecheckout-admin-settings-page.php index 7118fad..3e9e904 100644 --- a/includes/admin/class-wc-postfinancecheckout-admin-settings-page.php +++ b/includes/admin/class-wc-postfinancecheckout-admin-settings-page.php @@ -184,7 +184,7 @@ public function get_settings() { $settings = array( array( 'links' => array( - 'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.2-beta/docs/en/documentation.html' => esc_html__( 'Documentation', 'woo-postfinancecheckout' ), + 'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.2/docs/en/documentation.html' => esc_html__( 'Documentation', 'woo-postfinancecheckout' ), 'https://checkout.postfinance.ch/en-ch/user/signup' => esc_html__( 'Sign Up', 'woo-postfinancecheckout' ), ), 'type' => 'postfinancecheckout_links', diff --git a/includes/admin/class-wc-postfinancecheckout-admin-transaction.php b/includes/admin/class-wc-postfinancecheckout-admin-transaction.php index cf32cd9..4be1335 100644 --- a/includes/admin/class-wc-postfinancecheckout-admin-transaction.php +++ b/includes/admin/class-wc-postfinancecheckout-admin-transaction.php @@ -34,8 +34,7 @@ public static function init() { __CLASS__, 'add_meta_box', ), - 40, - 2 + 40 ); } @@ -43,14 +42,10 @@ public static function init() { * Add WC Meta boxes. * * @see: https://woo.com/document/high-performance-order-storage/#section-8 - * @see: https://developer.wordpress.org/reference/hooks/add_meta_boxes/ */ - public static function add_meta_box( $post_type = "", $post_or_order_object = null ) { - // WooCommerce is moving the Order information from Post to Order class. For now, we need to support both ways. - if ( empty( $post_or_order_object ) || ! ( $post_or_order_object instanceof \Automattic\WooCommerce\Admin\Overrides\Order) ) { - if ( empty( $post_or_order_object ) || ! ( $post_or_order_object instanceof WP_Post ) || empty( $post_or_order_object->ID ) || 'shop_order' != $post_or_order_object->post_type ) { - return; - } + public static function add_meta_box() { + if ( empty( $post ) || ! ( $post instanceof WP_Post ) || empty( $post->ID ) || 'shop_order' != $post->post_type ) { + return; } $screen = class_exists( '\Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController' ) && wc_get_container()->get( \Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled() diff --git a/includes/class-wc-postfinancecheckout-migration.php b/includes/class-wc-postfinancecheckout-migration.php index 8260aee..0402106 100644 --- a/includes/class-wc-postfinancecheckout-migration.php +++ b/includes/class-wc-postfinancecheckout-migration.php @@ -267,7 +267,7 @@ public static function check_version() { public static function plugin_row_meta( $links, $file ) { if ( WC_POSTFINANCECHECKOUT_PLUGIN_BASENAME === $file ) { $row_meta = array( - 'docs' => '' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '', + 'docs' => '' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '', ); return array_merge( $links, $row_meta ); diff --git a/readme.txt b/readme.txt index 29f4035..d5487a6 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: postfinancecheckout AG Tags: woocommerce PostFinance Checkout, woocommerce, PostFinance Checkout, payment, e-commerce, webshop, psp, invoice, packing slips, pdf, customer invoice, processing Requires at least: 4.7 Tested up to: 6.6 -Stable tag: 3.3.2-beta +Stable tag: 3.3.2 License: Apache 2 License URI: http://www.apache.org/licenses/LICENSE-2.0 @@ -23,7 +23,7 @@ To use this extension, a PostFinance Checkout account is required. Sign up on [P == Documentation == -Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.2-beta/docs/en/documentation.html). +Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.2/docs/en/documentation.html). == Support == diff --git a/woocommerce-postfinancecheckout.php b/woocommerce-postfinancecheckout.php index df5d7a8..feab61c 100644 --- a/woocommerce-postfinancecheckout.php +++ b/woocommerce-postfinancecheckout.php @@ -3,7 +3,7 @@ * Plugin Name: PostFinance Checkout * Plugin URI: https://wordpress.org/plugins/woo-postfinance-checkout * Description: Process WooCommerce payments with PostFinance Checkout. - * Version: 3.3.2-beta + * Version: 3.3.2 * Author: postfinancecheckout AG * Author URI: https://postfinance.ch/en/business/products/e-commerce/postfinance-checkout-all-in-one.html * Text Domain: postfinancecheckout @@ -11,7 +11,7 @@ * Requires at least: 6.0 * Requires PHP: 7.4 * WC requires at least: 8.0.0 - * WC tested up to 9.4.2 + * WC tested up to 9.3.1 * License: Apache 2 * License URI: http://www.apache.org/licenses/LICENSE-2.0 */ @@ -46,7 +46,7 @@ final class WooCommerce_PostFinanceCheckout { * * @var string */ - private $version = '3.3.2-beta'; + private $version = '3.3.2'; /** * The single instance of the class. @@ -693,7 +693,7 @@ function () { // The goal here is to speed up the process of registering the payment methods. $payment_methods = WC_PostFinanceCheckout_Blocks_Support::get_payment_methods(); $json_data = json_encode( $payment_methods ); - $content .= '
    '; + $content .= '
    '; } return $content;