Plugin Directory

Changeset 3250059


Ignore:
Timestamp:
03/04/2025 05:25:13 AM (13 months ago)
Author:
oaron
Message:

Nw version: 3.8.1

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

    r3184505 r3250059  
    6060
    6161        $order->add_order_note(__('Barion callback received.', 'pay-via-barion-for-woocommerce') . ' paymentId: "' . $_GET['paymentId'] . '"');
    62 
     62if ($order->meta_exists('_barion_payment_close')) {
     63                $order->add_order_note(__('Barion callback ignored, the payment closed.', 'pay-via-barion-for-woocommerce'));
     64            exit;
     65}
    6366        if(apply_filters('woocommerce_barion_custom_callback_handler', false, $order, $payment_details)) {
    6467            $order->add_order_note(__('Barion callback was handled by a custom handler.', 'pay-via-barion-for-woocommerce'));
     
    8891            $order->add_order_note(__('Payment succeeded via Barion.', 'pay-via-barion-for-woocommerce'));
    8992            $this->gateway->payment_complete($order, $this->find_transaction_id($payment_details, $order));
    90 
     93if ($order->meta_exists('_barion_payment_close')) {
     94                                                $order->update_meta_data("_barion_payment_close", 1);                       
     95                                                                                            } else {
     96                        $order->add_meta_data("_barion_payment_close", 1);
     97                                                                    }
     98                $order->save();
    9199            exit;
    92100        }
  • pay-via-barion-for-woocommerce/trunk/includes/class-wc-gateway-barion-request.php

    r3145670 r3250059  
    7575            $itemModel->Name = $item['name'];
    7676            $itemModel->Description = $itemModel->Name;
    77             $itemModel->Unit = __('piece', 'pay-via-barion-for-woocommerce');
     77$translated_text = __('piece', 'pay-via-barion-for-woocommerce');
     78$itemModel->Unit = substr(empty($translated_text) ? 'piece' : (string)$translated_text, 0, 50);
    7879            $itemModel->Quantity = empty($item['qty']) ? 1 : $item['qty'];
    7980
    80             $itemModel->UnitPrice = $order->get_item_subtotal($item, true);
     81            $itemModel->Price = $order->get_item_subtotal($item, true);
    8182            $itemModel->ItemTotal = $order->get_line_subtotal($item, true);
    8283
  • pay-via-barion-for-woocommerce/trunk/index.php

    r3184505 r3250059  
    44Plugin URI: http://github.com/szelpe/woocommerce-barion
    55Description: Adds the ability to WooCommerce to pay via Barion
    6 Version: 3.8
     6Version: 3.8.1
    77Author: Aron Ocsvari <ugyfelszolgalat@bitron.hu>
    88Author URI: https://bitron.hu
     
    1111
    1212WC requires at least: 3.0.0
    13 WC tested up to: 9.3.3
     13WC tested up to: 9.7.0
    1414
    1515Text Domain: pay-via-barion-for-woocommerce
     
    2828
    2929    public function __construct() {
    30         add_action('plugins_loaded', [$this, 'init'], 10);
     30        add_action('init', [$this, 'translation_load'], 5);
     31        add_action('init', [$this, 'init'], 10);
     32        add_action('woocommerce_blocks_loaded', [$this, 'register_checkout_blocks']);
    3133    }
    32 
     34function translation_load() {
     35    load_plugin_textdomain('pay-via-barion-for-woocommerce', false, plugin_basename(dirname(__FILE__)) . "/languages");
     36}
    3337    function init() {
    34         load_plugin_textdomain('pay-via-barion-for-woocommerce', false, plugin_basename(dirname(__FILE__)) . "/languages");
     38   
    3539        if (!class_exists('WC_Payment_Gateway'))
    3640            return;
     
    5862            }
    5963        } );
    60 
    61         //Load checkout block class
    62         add_action( 'woocommerce_blocks_loaded', function() {
    63 
    64             if( ! class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) {
    65                 return;
    66             }
    67        
    68             require_once 'includes/class-wc-gateway-barion-block-checkout.php';
    69             add_action(
    70                 'woocommerce_blocks_payment_method_type_registration',
    71                 function( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) {
    72                     $payment_method_registry->register( new WC_Gateway_Barion_Blocks );
    73             } );
    74        
    75         } );
    76         //Adds notification to dashboard
     64                //Adds notification to dashboard
    7765        add_action('admin_notices', array($this, 'custom_admin_ad_notice'));
    7866        add_action('wp_ajax_custom_admin_ad_dismiss', array($this, 'custom_admin_ad_dismiss'));
    7967    }
     68    public function register_checkout_blocks() {
     69    if (!class_exists('Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType')) {
     70        return;
     71    }
     72
     73    // 🚀 **Először betöltjük a szükséges osztályokat** 🚀
     74    require_once 'includes/class-wc-gateway-barion-profile-monitor.php';
     75    require_once 'class-wc-gateway-barion.php';
     76
     77    require_once 'includes/class-wc-gateway-barion-block-checkout.php';
     78
     79    add_action(
     80        'woocommerce_blocks_payment_method_type_registration',
     81        function(Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry) {
     82            $payment_method_registry->register(new WC_Gateway_Barion_Blocks);
     83        }
     84    );
     85}
    8086    /**
    8187    * Shows a notification about Full Barion pixel
  • pay-via-barion-for-woocommerce/trunk/readme.txt

    r3184505 r3250059  
    33Tags: woocommerce, barion, gateway, payment
    44Requires at least: 4.0
    5 Tested up to: 6.6.2
     5Tested up to: 6.7.2
    66WC requires at least: 3.0.0
    7 WC tested up to: 9.3.3
     7WC tested up to: 9.7.0
    88Requires PHP: 5.6
    99Stable tag: trunk
     
    8989
    9090== Changelog ==
     91= 3.8.1 =
     92- Fixed load translation issue
     93- Fixed TranslatePress issue
     94- Fixed IPN callback issue
    9195= 3.8 =
    9296- Fixed the successfull order statuses list.
Note: See TracChangeset for help on using the changeset viewer.