Plugin Directory

Changeset 3263293


Ignore:
Timestamp:
03/28/2025 07:56:09 AM (12 months ago)
Author:
oaron
Message:

New version: 3.8.5

Location:
pay-via-barion-for-woocommerce/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pay-via-barion-for-woocommerce/trunk/includes/class-wc-gateway-barion-ipn-handler.php

    r3250059 r3263293  
    2424            exit;
    2525
    26 
    2726        $payment_details = $this->barion_client->GetPaymentState($_GET['paymentId']);
    2827
    2928        if(!empty($payment_details->Errors)) {
    30             WC_Gateway_Barion::log('GetPaymentState returned errors. Payment details: ' . json_encode($payment_details));
     29            $this->gateway::log('GetPaymentState returned errors. Payment details: ' . json_encode($payment_details));
    3130
    3231            exit;
     
    5150   $order = new WC_Order($payment_details->PaymentRequestId);
    5251}
    53 
    54        
     52        $this->gateway::log("IPN called, orderid: ".$order->get_id());
     53       
     54        if ($_GET['paymentId'] !=$this->gateway->get_barion_payment_id($order)) {
     55                        $this->gateway::log("IPN blocked, Barion id is not match.");
     56            exit;
     57        }
     58               
    5559        if(empty($order)) {
    56             WC_Gateway_Barion::log('Invalid PaymentRequestId: ' . $_GET['paymentId'] . '. Payment details: ' . json_encode($payment_details));
    57 
     60            $this->gateway::log('Invalid PaymentRequestId: ' . $_GET['paymentId'] . '. Payment details: ' . json_encode($payment_details));
    5861            exit;
    5962        }
    60 
    6163        $order->add_order_note(__('Barion callback received.', 'pay-via-barion-for-woocommerce') . ' paymentId: "' . $_GET['paymentId'] . '"');
    6264if ($order->meta_exists('_barion_payment_close')) {
    6365                $order->add_order_note(__('Barion callback ignored, the payment closed.', 'pay-via-barion-for-woocommerce'));
    64             exit;
     66                $this->gateway::log("IPN ignored, order closed");
     67                            exit;
    6568}
    6669        if(apply_filters('woocommerce_barion_custom_callback_handler', false, $order, $payment_details)) {
     
    9093
    9194            $order->add_order_note(__('Payment succeeded via Barion.', 'pay-via-barion-for-woocommerce'));
    92             $this->gateway->payment_complete($order, $this->find_transaction_id($payment_details, $order));
    93 if ($order->meta_exists('_barion_payment_close')) {
     95            if ($order->meta_exists('_barion_payment_close')) {
    9496                                                $order->update_meta_data("_barion_payment_close", 1);                       
    9597                                                                                            } else {
     
    9799                                                                    }
    98100                $order->save();
     101
     102            $this->gateway->payment_complete($order, $this->find_transaction_id($payment_details, $order));
    99103            exit;
    100104        }
     
    122126
    123127        $order->update_status('failed', __('Payment failed via Barion.', 'pay-via-barion-for-woocommerce'));
    124         WC_Gateway_Barion::log('Payment failed. Payment details: ' . json_encode($payment_details));
     128        $this->gateway::log('Payment failed. Payment details: ' . json_encode($payment_details));
    125129        exit;
    126130    }
  • pay-via-barion-for-woocommerce/trunk/includes/class-wc-gateway-barion-pixel.php

    r2812812 r3263293  
    88     * @param $barion_pixel_id string
    99     */
    10     public function __construct($barion_pixel_id) {
    11         $this->barion_pixel_id = $barion_pixel_id;
     10    public function __construct() {
     11        $settings = get_option('woocommerce_barion_settings');
     12        $this->barion_pixel_id = $settings["barion_pixel_id"];
    1213
    1314        add_action('wp_head', [$this, 'add_barion_pixel'], 999999);
  • pay-via-barion-for-woocommerce/trunk/index.php

    r3251799 r3263293  
    44Plugin URI: http://github.com/szelpe/woocommerce-barion
    55Description: Adds the ability to WooCommerce to pay via Barion
    6 Version: 3.8.4
     6Version: 3.8.5
    77Author: Aron Ocsvari <ugyfelszolgalat@bitron.hu>
    88Author URI: https://bitron.hu
     
    5454        require_once 'includes/class-wc-gateway-barion-pixel.php';
    5555       
     56$this->barion_pixel = new WC_Gateway_Barion_Pixel();       
    5657
    5758   add_filter('woocommerce_payment_gateways', [$this, 'woocommerce_add_gateway_barion_gateway']);
     
    121122        $this->profile_monitor = new WC_Gateway_Barion_Profile_Monitor();
    122123        $this->wc_gateway_barion = new WC_Gateway_Barion($this->profile_monitor);
    123 $this->barion_pixel = new WC_Gateway_Barion_Pixel($this->wc_gateway_barion->get_barion_pixel_id());     
    124124        $methods[] = $this->wc_gateway_barion;
    125125        return $methods;
  • pay-via-barion-for-woocommerce/trunk/readme.txt

    r3250177 r3263293  
    8989
    9090== Changelog ==
     91= 3.8.5 =
     92* Fix: Barion pixel load issue
     93* Fix: Prevent order status changes from expired payments when successful payment exists
    9194= 3.8.2 =
    9295* Fix: HPOS compatibility issue
Note: See TracChangeset for help on using the changeset viewer.