Plugin Directory

Changeset 3417443


Ignore:
Timestamp:
12/11/2025 02:01:50 PM (4 months ago)
Author:
estogroup
Message:

Deploy version 3.0.13 to trunk

Location:
esto-payment-methods/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • esto-payment-methods/trunk/Readme.txt

    r3417199 r3417443  
    11=== ESTO payment methods ===
    22Contributors: estogroup
    3 Stable tag: 3.0.12
     3Stable tag: 3.0.13
    44Requires at least: 4.2
    55Tested up to: 6.8
     
    114114
    115115== Changelog ==
     116= 3.0.13 =
     117* Improved: Callback processing now works reliably across different hosting setups
     118
    116119= 3.0.12 =
    117120* Improved: Calculator supporting variable products
  • esto-payment-methods/trunk/esto-payment-methods.php

    r3417199 r3417443  
    44 * Plugin URI: https://www.esto.ee
    55 * Description: Adds ESTO payment methods to webshop
    6  * Version: 3.0.12
     6 * Version: 3.0.13
    77 * Author: ESTO AS
    88 * Author URI: https://www.esto.eu
  • esto-payment-methods/trunk/includes/class-esto-callback-handler.php

    r3410890 r3417443  
    268268            esto_log( 'Error processing ESTO callback: ' . $e->getMessage(), 'error' );
    269269            ob_end_clean();
    270             wp_die( 'Payment callback verification failed. Please notify merchant.', 'Callback Error', array( 'response' => 403 ) );
     270            wp_die( 'Payment callback verification failed. Please notify merchant.', 'Callback Error', array( 'response' => 422 ) );
    271271        }
    272272    }
     
    288288        esto_log( 'Test mode enabled in settings: ' . ( $this->is_test_mode ? 'YES' : 'NO' ) );
    289289
    290         $request_method = sanitize_text_field( wp_unslash( filter_input( INPUT_SERVER, 'REQUEST_METHOD', FILTER_SANITIZE_STRING ) ?? '' ) );
    291         esto_log( 'Request method: ' . $request_method );
     290        $request_method = sanitize_text_field( wp_unslash( $_SERVER['REQUEST_METHOD'] ?? '' ) );
     291
     292        // Fallback if request method is empty.
     293        if ( empty( $request_method ) ) {
     294            // phpcs:ignore WordPress.Security.NonceVerification.Missing -- External callback validation using MAC
     295            if ( ! empty( $_POST ) ) {
     296                $request_method = 'POST';
     297
     298            } elseif ( ! empty( $_GET ) ) {  // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- External callback validation using MAC
     299                $request_method = 'GET';
     300            } else {
     301                esto_log( 'No request method and no input data detected' );
     302                throw new Exception( 'Unable to detect request method.' );
     303            }
     304        }
    292305
    293306        if ( 'GET' === $request_method ) {
Note: See TracChangeset for help on using the changeset viewer.