Plugin Directory

Changeset 3443987


Ignore:
Timestamp:
01/21/2026 11:00:32 AM (2 months ago)
Author:
estogroup
Message:

Deploy version 3.0.16 to trunk

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

Legend:

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

    r3439262 r3443987  
    11=== ESTO payment methods ===
    22Contributors: estogroup
    3 Stable tag: 3.0.15
     3Stable tag: 3.0.16
    44Requires at least: 4.2
    55Tested up to: 6.9
     
    8181
    8282== Changelog ==
     83= 3.0.16 =
     84* Improved: Custom order references will be synced with Affiliate Portal
     85
    8386= 3.0.15 =
    8487* Fixed deprecated notice (ESTO X calculator)
  • esto-payment-methods/trunk/esto-payment-methods.php

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

    r3417443 r3443987  
    102102     * Get the order reference from the callback data.
    103103     *
     104     * When merchant_message not equals with reference, we treat merchant_message as the real order reference.
     105     * Otherwise we fall back to using reference.
     106     *
    104107     * @return int Order ID.
    105108     * @throws Exception If no reference is found.
    106109     */
    107110    private function esto_get_order_reference() {
     111
    108112        if ( empty( $this->request_data['reference'] ) ) {
    109113            throw new Exception( 'Missing reference in callback data.' );
    110114        }
    111         $this->reference = $this->request_data['reference'];
    112         esto_log( 'Using reference: ' . $this->reference );
     115
     116        $reference        = (string) $this->request_data['reference'];
     117        $merchant_message = isset( $this->request_data['merchant_message'] )
     118            ? (string) $this->request_data['merchant_message']
     119            : '';
     120
     121        // Detect custom webshop order reference usage.
     122        if ( ! empty( $merchant_message ) && $merchant_message !== $reference ) {
     123            $this->reference = $merchant_message;
     124            esto_log( 'Custom order reference detected: ' . $this->reference );
     125        } else {
     126            $this->reference = $reference;
     127            esto_log( 'Using order reference for validation: ' . $this->reference );
     128        }
    113129
    114130        $order_id = (int) $this->reference;
    115131        esto_log( 'Looking up order ID: ' . $order_id );
    116132
    117         return $this->reference;
     133        return $order_id;
    118134    }
    119135
  • esto-payment-methods/trunk/includes/class-esto-request.php

    r3417199 r3443987  
    426426            'shop_id'          => $this->shop_id,
    427427            'amount'           => $this->order->get_total(),
    428             'reference'        => (string) $wp_order_id,
    429             'message'          => (string) $order_id,
     428            'reference'        => (string) $order_id,
     429            'message'          => (string) $wp_order_id,
    430430            'return_url'       => site_url( '/wc-api/esto-callback' ),
    431431            'notification_url' => site_url( '/wc-api/esto-callback' ),
Note: See TracChangeset for help on using the changeset viewer.