Plugin Directory

Changeset 3297790


Ignore:
Timestamp:
05/21/2025 06:46:51 AM (10 months ago)
Author:
netingweb
Message:

Releasing version 20250521 - Fix: Loading issues in iframe mode (storefront theme). TLS and browser check scripts.

Location:
gestpay-for-woocommerce
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • gestpay-for-woocommerce/tags/20250521/gestpay-for-woocommerce.php

    r3297391 r3297790  
    44 * Plugin URI: http://wordpress.org/plugins/gestpay-for-woocommerce/
    55 * Description: Abilita il sistema di pagamento GestPay by Axerve (Gruppo Banca Sella) in WooCommerce.
    6  * Version: 20250520
     6 * Version: 20250521
    77 * Requires at least: 4.7
    88 * Requires PHP: 7.0
     
    213213            $this->is_tokenization = $this->is_s2s || $this->is_iframe;
    214214
     215            error_log('Gestpay Config - Account type: ' . $this->account);
     216            error_log('Gestpay Config - is_s2s: ' . ($this->is_s2s ? 'true' : 'false'));
     217            error_log('Gestpay Config - is_iframe: ' . ($this->is_iframe ? 'true' : 'false'));
     218            error_log('Gestpay Config - is_tokenization: ' . ($this->is_tokenization ? 'true' : 'false'));
     219
    215220            // For token+auth output a payment_box containing the direct payment form
    216221            $this->has_fields      = $this->is_s2s;
     
    327332            if ( function_exists( 'is_checkout' ) && is_checkout() ) {
    328333                // Include TLS js by Gestpay
    329                 wp_enqueue_script( 'gestpay-TLSCHK_TE', '//sandbox.gestpay.net/pagam/javascript/TLSCHK_TE.js', array(), '201804', true );
    330                 wp_enqueue_script( 'gestpay-TLSCHK_PRO', '//ecomm.sella.it/pagam/javascript/TLSCHK_PRO.js', array(), '201804', true );
     334                error_log('Gestpay Scripts - Caricamento script TLS e browser check');
    331335                wp_enqueue_script( 'gestpay-checkBrowser', '//www.gestpay.it/checkbrowser/checkBrowser.js', array(), '201804', true );
     336                wp_enqueue_script( 'gestpay-TLSCHK_TE', '//sandbox.gestpay.net/pagam/javascript/TLSCHK_TE.js', array('gestpay-checkBrowser'), '201804', true );
     337                wp_enqueue_script( 'gestpay-TLSCHK_PRO', '//ecomm.sella.it/pagam/javascript/TLSCHK_PRO.js', array('gestpay-checkBrowser'), '201804', true );
    332338            }
    333339
  • gestpay-for-woocommerce/tags/20250521/inc/class-gestpay-iframe.php

    r3276807 r3297790  
    115115     */
    116116    public function receipt_page( $order ) {
    117 
     117        error_log('Gestpay iFrame - Inizio receipt_page');
    118118        $encString = $this->retrieve_encoded_string( $order );
     119        error_log('Gestpay iFrame - Stringa crittografata: ' . $encString);
    119120
    120121        // Maybe get the paRes parameter for 2nd call, due to 3D enrolled credit card
    121122        $paRes = ! empty( $_REQUEST["PaRes"] ) ? sanitize_text_field( wp_unslash( $_REQUEST["PaRes"] ) ) : "";
    122123        $transKey = ! empty( $_COOKIE['TransKey'] ) ? sanitize_text_field( wp_unslash( $_COOKIE['TransKey'] ) ) : "";
     124        error_log('Gestpay iFrame - paRes: ' . $paRes . ', transKey: ' . $transKey);
    123125
    124126        // Output the HTML for the iFrame payment box.
    125127        require_once 'checkout-payment-fields.php';
    126128        wp_enqueue_script( 'gestpay-for-woocommerce-iframe-js', $this->Gestpay->iframe_url );
     129        error_log('Gestpay iFrame - Script iframe caricato: ' . $this->Gestpay->iframe_url);
    127130        ?>
    128131
     
    278281        }
    279282
    280         if ( BrowserEnabled ) {
    281             // Check if the browser support HTML5 postmessage
    282 
    283             var a = '<?php echo esc_js( $this->Gestpay->shopLogin ); ?>';
    284             var b = '<?php echo esc_js( $encString ); ?>';
    285 
    286             // Create the iFrame
    287             GestPay.CreatePaymentPage( a, b, GestpayIframe.PaymentPageLoad );
    288 
    289             // Raise the Overlap layer and text
    290             document.getElementById( 'gestpay-freeze-pane' ).className = 'gestpay-freeze-pane-on';
    291             document.getElementById( 'gestpay-inner-freeze-pane-text' ).innerHTML = '<?php echo esc_js( $this->Gestpay->strings['iframe_loading'] ); ?>';
    292             document.getElementById( 'gestpay-inner-freeze-pane' ).className = 'gestpay-on';
    293         }
    294         else {
    295             document.getElementById( 'gestpay-error-box' ).innerHTML = '<?php echo esc_js( $this->Gestpay->strings['iframe_browser_err'] ); ?>';
    296             document.getElementById( 'gestpay-error-box' ).className = 'gestpay-on';
    297         }
    298 
     283        jQuery(document).ready(function($) {
     284            if (typeof BrowserEnabled !== 'undefined' && BrowserEnabled) {
     285                // Check if the browser support HTML5 postmessage
     286                var a = '<?php echo esc_js( $this->Gestpay->shopLogin ); ?>';
     287                var b = '<?php echo esc_js( $encString ); ?>';
     288
     289                // Create the iFrame
     290                GestPay.CreatePaymentPage( a, b, GestpayIframe.PaymentPageLoad );
     291
     292                // Raise the Overlap layer and text
     293                document.getElementById( 'gestpay-freeze-pane' ).className = 'gestpay-freeze-pane-on';
     294                document.getElementById( 'gestpay-inner-freeze-pane-text' ).innerHTML = '<?php echo esc_js( $this->Gestpay->strings['iframe_loading'] ); ?>';
     295                document.getElementById( 'gestpay-inner-freeze-pane' ).className = 'gestpay-on';
     296            }
     297            else {
     298                document.getElementById( 'gestpay-error-box' ).innerHTML = '<?php echo esc_js( $this->Gestpay->strings['iframe_browser_err'] ); ?>';
     299                document.getElementById( 'gestpay-error-box' ).className = 'gestpay-on';
     300            }
     301        });
    299302        </script>
    300303
  • gestpay-for-woocommerce/tags/20250521/readme.txt

    r3297391 r3297790  
    55Requires PHP: 7.0
    66Tested up to: 6.8
    7 Stable tag: 20250520
     7Stable tag: 20250521
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6868
    6969== Changelog ==
     70= 20250521 =
     71* Fix: Improved iframe payment loading and stability
     72  - Fixed JavaScript loading order for payment scripts
     73  - Added robust BrowserEnabled check
     74  - Optimized iframe initialization code
     75  - Fixed "BrowserEnabled is not defined" error
     76* Security: Nothing added
     77* Improvement: Enhanced payment iframe reliability
     78* Checks: Verified compatibility with WordPress 6.8, WooCommerce 9.4.2
     79* Note: This update improves the payment iframe stability and fixes loading issues
     80
    7081= 20250520 =
    7182* Security: enforced CSRF protection
  • gestpay-for-woocommerce/trunk/gestpay-for-woocommerce.php

    r3297391 r3297790  
    44 * Plugin URI: http://wordpress.org/plugins/gestpay-for-woocommerce/
    55 * Description: Abilita il sistema di pagamento GestPay by Axerve (Gruppo Banca Sella) in WooCommerce.
    6  * Version: 20250520
     6 * Version: 20250521
    77 * Requires at least: 4.7
    88 * Requires PHP: 7.0
     
    213213            $this->is_tokenization = $this->is_s2s || $this->is_iframe;
    214214
     215            error_log('Gestpay Config - Account type: ' . $this->account);
     216            error_log('Gestpay Config - is_s2s: ' . ($this->is_s2s ? 'true' : 'false'));
     217            error_log('Gestpay Config - is_iframe: ' . ($this->is_iframe ? 'true' : 'false'));
     218            error_log('Gestpay Config - is_tokenization: ' . ($this->is_tokenization ? 'true' : 'false'));
     219
    215220            // For token+auth output a payment_box containing the direct payment form
    216221            $this->has_fields      = $this->is_s2s;
     
    327332            if ( function_exists( 'is_checkout' ) && is_checkout() ) {
    328333                // Include TLS js by Gestpay
    329                 wp_enqueue_script( 'gestpay-TLSCHK_TE', '//sandbox.gestpay.net/pagam/javascript/TLSCHK_TE.js', array(), '201804', true );
    330                 wp_enqueue_script( 'gestpay-TLSCHK_PRO', '//ecomm.sella.it/pagam/javascript/TLSCHK_PRO.js', array(), '201804', true );
     334                error_log('Gestpay Scripts - Caricamento script TLS e browser check');
    331335                wp_enqueue_script( 'gestpay-checkBrowser', '//www.gestpay.it/checkbrowser/checkBrowser.js', array(), '201804', true );
     336                wp_enqueue_script( 'gestpay-TLSCHK_TE', '//sandbox.gestpay.net/pagam/javascript/TLSCHK_TE.js', array('gestpay-checkBrowser'), '201804', true );
     337                wp_enqueue_script( 'gestpay-TLSCHK_PRO', '//ecomm.sella.it/pagam/javascript/TLSCHK_PRO.js', array('gestpay-checkBrowser'), '201804', true );
    332338            }
    333339
  • gestpay-for-woocommerce/trunk/inc/class-gestpay-iframe.php

    r3276807 r3297790  
    115115     */
    116116    public function receipt_page( $order ) {
    117 
     117        error_log('Gestpay iFrame - Inizio receipt_page');
    118118        $encString = $this->retrieve_encoded_string( $order );
     119        error_log('Gestpay iFrame - Stringa crittografata: ' . $encString);
    119120
    120121        // Maybe get the paRes parameter for 2nd call, due to 3D enrolled credit card
    121122        $paRes = ! empty( $_REQUEST["PaRes"] ) ? sanitize_text_field( wp_unslash( $_REQUEST["PaRes"] ) ) : "";
    122123        $transKey = ! empty( $_COOKIE['TransKey'] ) ? sanitize_text_field( wp_unslash( $_COOKIE['TransKey'] ) ) : "";
     124        error_log('Gestpay iFrame - paRes: ' . $paRes . ', transKey: ' . $transKey);
    123125
    124126        // Output the HTML for the iFrame payment box.
    125127        require_once 'checkout-payment-fields.php';
    126128        wp_enqueue_script( 'gestpay-for-woocommerce-iframe-js', $this->Gestpay->iframe_url );
     129        error_log('Gestpay iFrame - Script iframe caricato: ' . $this->Gestpay->iframe_url);
    127130        ?>
    128131
     
    278281        }
    279282
    280         if ( BrowserEnabled ) {
    281             // Check if the browser support HTML5 postmessage
    282 
    283             var a = '<?php echo esc_js( $this->Gestpay->shopLogin ); ?>';
    284             var b = '<?php echo esc_js( $encString ); ?>';
    285 
    286             // Create the iFrame
    287             GestPay.CreatePaymentPage( a, b, GestpayIframe.PaymentPageLoad );
    288 
    289             // Raise the Overlap layer and text
    290             document.getElementById( 'gestpay-freeze-pane' ).className = 'gestpay-freeze-pane-on';
    291             document.getElementById( 'gestpay-inner-freeze-pane-text' ).innerHTML = '<?php echo esc_js( $this->Gestpay->strings['iframe_loading'] ); ?>';
    292             document.getElementById( 'gestpay-inner-freeze-pane' ).className = 'gestpay-on';
    293         }
    294         else {
    295             document.getElementById( 'gestpay-error-box' ).innerHTML = '<?php echo esc_js( $this->Gestpay->strings['iframe_browser_err'] ); ?>';
    296             document.getElementById( 'gestpay-error-box' ).className = 'gestpay-on';
    297         }
    298 
     283        jQuery(document).ready(function($) {
     284            if (typeof BrowserEnabled !== 'undefined' && BrowserEnabled) {
     285                // Check if the browser support HTML5 postmessage
     286                var a = '<?php echo esc_js( $this->Gestpay->shopLogin ); ?>';
     287                var b = '<?php echo esc_js( $encString ); ?>';
     288
     289                // Create the iFrame
     290                GestPay.CreatePaymentPage( a, b, GestpayIframe.PaymentPageLoad );
     291
     292                // Raise the Overlap layer and text
     293                document.getElementById( 'gestpay-freeze-pane' ).className = 'gestpay-freeze-pane-on';
     294                document.getElementById( 'gestpay-inner-freeze-pane-text' ).innerHTML = '<?php echo esc_js( $this->Gestpay->strings['iframe_loading'] ); ?>';
     295                document.getElementById( 'gestpay-inner-freeze-pane' ).className = 'gestpay-on';
     296            }
     297            else {
     298                document.getElementById( 'gestpay-error-box' ).innerHTML = '<?php echo esc_js( $this->Gestpay->strings['iframe_browser_err'] ); ?>';
     299                document.getElementById( 'gestpay-error-box' ).className = 'gestpay-on';
     300            }
     301        });
    299302        </script>
    300303
  • gestpay-for-woocommerce/trunk/readme.txt

    r3297391 r3297790  
    55Requires PHP: 7.0
    66Tested up to: 6.8
    7 Stable tag: 20250520
     7Stable tag: 20250521
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6868
    6969== Changelog ==
     70= 20250521 =
     71* Fix: Improved iframe payment loading and stability
     72  - Fixed JavaScript loading order for payment scripts
     73  - Added robust BrowserEnabled check
     74  - Optimized iframe initialization code
     75  - Fixed "BrowserEnabled is not defined" error
     76* Security: Nothing added
     77* Improvement: Enhanced payment iframe reliability
     78* Checks: Verified compatibility with WordPress 6.8, WooCommerce 9.4.2
     79* Note: This update improves the payment iframe stability and fixes loading issues
     80
    7081= 20250520 =
    7182* Security: enforced CSRF protection
Note: See TracChangeset for help on using the changeset viewer.