Plugin Directory

Changeset 3440427


Ignore:
Timestamp:
01/15/2026 02:30:38 PM (8 weeks ago)
Author:
packlink
Message:

Release of version 3.6.2

Location:
packlink-pro-shipping
Files:
1051 added
12 edited

Legend:

Unmodified
Added
Removed
  • packlink-pro-shipping/trunk/changelog.txt

    r3394375 r3440427  
    11*** Packlink PRO Changelog ***
     2
     32026-01-15 - version 3.6.2
     4* Update core version to 3.7.2
     5* Fix error on filtering payment gateways
    26
    372025-11-12 - version 3.6.1
  • packlink-pro-shipping/trunk/class-plugin.php

    r3379500 r3440427  
    437437     * @throws RepositoryNotRegisteredException
    438438     */
    439     public function filter_payment_gateways( $available_gateways ) {
    440 
    441         if ( is_admin()) {
    442             return $available_gateways;
    443         }
    444 
    445         $chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
    446 
    447         if ( empty( $chosen_shipping_methods ) ) {
    448             return $available_gateways;
    449         }
    450 
    451         $chosen_shipping = $chosen_shipping_methods[0];
    452 
    453 
    454         $parts = explode( ':', $chosen_shipping );
    455         $instance_id = isset( $parts[1] ) ? (int) $parts[1] : 0;
    456 
    457         if (  $parts[0] !== Packlink_Shipping_Method::PACKLINK_SHIPPING_METHOD || $instance_id <= 0 ) {
    458             return $available_gateways;
    459         }
    460 
    461         $packlink_method = Shipping_Method_Helper::get_packlink_shipping_method( $instance_id );
    462 
    463         if ( $packlink_method ) {
    464             $cod_controller = new \Packlink\WooCommerce\Controllers\Packlink_Cash_On_Delivery_Controller();
    465 
    466             return $cod_controller->get_available_payments($packlink_method->getId(), $available_gateways);
    467         }
    468 
    469         return $available_gateways;
    470     }
     439    public function filter_payment_gateways( $available_gateways ) {
     440        // Backend never
     441        if ( is_admin() ) {
     442            return $available_gateways;
     443        }
     444
     445        // If WC or session isn't ready, we are NOT in a context where chosen shipping is reliable.
     446        if ( ! function_exists( 'WC' ) || ! WC() || ! WC()->session ) {
     447            return $available_gateways;
     448        }
     449
     450        $uri = $_SERVER['REQUEST_URI'] ?? '';
     451
     452        if (defined('REST_REQUEST') && REST_REQUEST && strpos($uri, '/wp-json/wc/') === false) {
     453            return $available_gateways;
     454        }
     455
     456        $is_wc_ajax =
     457            (defined('WC_DOING_AJAX') && WC_DOING_AJAX)
     458            || (strpos($uri, 'wc-ajax=') !== false)
     459            || isset($_REQUEST['wc-ajax'])
     460            || (defined('DOING_AJAX') && DOING_AJAX);
     461
     462        $is_store_api = (defined('REST_REQUEST') && REST_REQUEST && strpos($uri, '/wp-json/wc/store/') !== false);
     463
     464        // Optional but recommended: only run where shipping choice exists.
     465        // PayPal smart buttons can call this on product pages; we must ignore that.
     466        if (!(is_checkout() || $is_wc_ajax || $is_store_api)) {
     467            return $available_gateways;
     468        }
     469
     470        $chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
     471        if ( empty( $chosen_shipping_methods ) || empty( $chosen_shipping_methods[0] ) ) {
     472            return $available_gateways;
     473        }
     474
     475        $chosen_shipping = $chosen_shipping_methods[0];
     476
     477        $parts = explode( ':', $chosen_shipping );
     478        $method_id   = isset($parts[0]) ? $parts[0] : '';
     479        $instance_id = isset($parts[1]) ? (int) $parts[1] : 0;
     480
     481        if ( $method_id !== Packlink_Shipping_Method::PACKLINK_SHIPPING_METHOD || $instance_id <= 0 ) {
     482            return $available_gateways;
     483        }
     484
     485        $packlink_method = Shipping_Method_Helper::get_packlink_shipping_method( $instance_id );
     486        if ( ! $packlink_method ) {
     487            return $available_gateways;
     488        }
     489
     490        $cod_controller = new \Packlink\WooCommerce\Controllers\Packlink_Cash_On_Delivery_Controller();
     491        return $cod_controller->get_available_payments( $packlink_method->getId(), $available_gateways );
     492    }
     493
    471494
    472495    /**
  • packlink-pro-shipping/trunk/composer.json

    r3379500 r3440427  
    22  "name": "packlink/woocommerce",
    33  "description": "Packlink WooCommerce Integration",
    4   "version": "3.6.0",
     4  "version": "3.6.2",
    55  "type": "library",
    66  "repositories": [
     
    1313  "require": {
    1414    "php": ">=5.6",
    15     "packlink/integration-core": "3.7.0",
     15    "packlink/integration-core": "3.7.2",
    1616    "ext-json": "*",
    1717    "ext-curl": "*",
  • packlink-pro-shipping/trunk/composer.lock

    r3379500 r3440427  
    55        "This file is @generated automatically"
    66    ],
    7     "content-hash": "40161d5e2b1ddeadcdc7db24953061bd",
     7    "content-hash": "dd4e4d699fbe66bc2d04e3cab387f4ed",
    88    "packages": [
    99        {
     
    6363        {
    6464            "name": "packlink/integration-core",
    65             "version": "v3.7.0",
     65            "version": "v3.7.2",
    6666            "source": {
    6767                "type": "git",
    6868                "url": "git@github.com:packlink-dev/ecommerce_module_core.git",
    69                 "reference": "fc2a9012e503fa4a1402eb377e7984c71c973d23"
    70             },
    71             "dist": {
    72                 "type": "zip",
    73                 "url": "https://api.github.com/repos/packlink-dev/ecommerce_module_core/zipball/fc2a9012e503fa4a1402eb377e7984c71c973d23",
    74                 "reference": "fc2a9012e503fa4a1402eb377e7984c71c973d23",
     69                "reference": "37f5a860a2e6fe4794e2e2b0e4424d7e7a682044"
     70            },
     71            "dist": {
     72                "type": "zip",
     73                "url": "https://api.github.com/repos/packlink-dev/ecommerce_module_core/zipball/37f5a860a2e6fe4794e2e2b0e4424d7e7a682044",
     74                "reference": "37f5a860a2e6fe4794e2e2b0e4424d7e7a682044",
    7575                "shasum": ""
    7676            },
     
    111111            ],
    112112            "description": "Packlink integrations core library",
    113             "time": "2025-10-14T07:05:43+00:00"
     113            "time": "2026-01-14T10:02:49+00:00"
    114114        },
    115115        {
  • packlink-pro-shipping/trunk/readme.txt

    r3414450 r3440427  
    55Requires PHP: 5.5
    66Tested up to: 6.9
    7 Stable tag: 3.6.1
     7Stable tag: 3.6.2
    88License: LICENSE-2.0
    99License URI: http://www.apache.org/licenses/LICENSE-2.0
     
    9595== Changelog ==
    9696
     97#### 3.6.2 - January 15th, 2026
     98
     99**Updates**
     100- Fix error on filtering payment gateways
     101
    97102#### 3.6.1 - November 12th, 2025
    98103
  • packlink-pro-shipping/trunk/vendor/autoload.php

    r3414450 r3440427  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInit76af1a3674fae21b21668d4734ec46b2::getLoader();
     7return ComposerAutoloaderInit82f9d6ce3e4dc5b0591999724729efa1::getLoader();
  • packlink-pro-shipping/trunk/vendor/composer/autoload_real.php

    r3414450 r3440427  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit76af1a3674fae21b21668d4734ec46b2
     5class ComposerAutoloaderInit82f9d6ce3e4dc5b0591999724729efa1
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit76af1a3674fae21b21668d4734ec46b2', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit82f9d6ce3e4dc5b0591999724729efa1', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit76af1a3674fae21b21668d4734ec46b2', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit82f9d6ce3e4dc5b0591999724729efa1', 'loadClassLoader'));
    3030
    3131        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    3333            require __DIR__ . '/autoload_static.php';
    3434
    35             call_user_func(\Composer\Autoload\ComposerStaticInit76af1a3674fae21b21668d4734ec46b2::getInitializer($loader));
     35            call_user_func(\Composer\Autoload\ComposerStaticInit82f9d6ce3e4dc5b0591999724729efa1::getInitializer($loader));
    3636        } else {
    3737            $map = require __DIR__ . '/autoload_namespaces.php';
  • packlink-pro-shipping/trunk/vendor/composer/autoload_static.php

    r3414450 r3440427  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit76af1a3674fae21b21668d4734ec46b2
     7class ComposerStaticInit82f9d6ce3e4dc5b0591999724729efa1
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    6363    {
    6464        return \Closure::bind(function () use ($loader) {
    65             $loader->prefixLengthsPsr4 = ComposerStaticInit76af1a3674fae21b21668d4734ec46b2::$prefixLengthsPsr4;
    66             $loader->prefixDirsPsr4 = ComposerStaticInit76af1a3674fae21b21668d4734ec46b2::$prefixDirsPsr4;
    67             $loader->classMap = ComposerStaticInit76af1a3674fae21b21668d4734ec46b2::$classMap;
     65            $loader->prefixLengthsPsr4 = ComposerStaticInit82f9d6ce3e4dc5b0591999724729efa1::$prefixLengthsPsr4;
     66            $loader->prefixDirsPsr4 = ComposerStaticInit82f9d6ce3e4dc5b0591999724729efa1::$prefixDirsPsr4;
     67            $loader->classMap = ComposerStaticInit82f9d6ce3e4dc5b0591999724729efa1::$classMap;
    6868
    6969        }, null, ClassLoader::class);
  • packlink-pro-shipping/trunk/vendor/composer/installed.json

    r3379500 r3440427  
    6060        {
    6161            "name": "packlink/integration-core",
    62             "version": "v3.7.0",
    63             "version_normalized": "3.7.0.0",
     62            "version": "v3.7.2",
     63            "version_normalized": "3.7.2.0",
    6464            "source": {
    6565                "type": "git",
    6666                "url": "git@github.com:packlink-dev/ecommerce_module_core.git",
    67                 "reference": "fc2a9012e503fa4a1402eb377e7984c71c973d23"
    68             },
    69             "dist": {
    70                 "type": "zip",
    71                 "url": "https://api.github.com/repos/packlink-dev/ecommerce_module_core/zipball/fc2a9012e503fa4a1402eb377e7984c71c973d23",
    72                 "reference": "fc2a9012e503fa4a1402eb377e7984c71c973d23",
     67                "reference": "37f5a860a2e6fe4794e2e2b0e4424d7e7a682044"
     68            },
     69            "dist": {
     70                "type": "zip",
     71                "url": "https://api.github.com/repos/packlink-dev/ecommerce_module_core/zipball/37f5a860a2e6fe4794e2e2b0e4424d7e7a682044",
     72                "reference": "37f5a860a2e6fe4794e2e2b0e4424d7e7a682044",
    7373                "shasum": ""
    7474            },
     
    8282                "phpunit/phpunit": "^4.8"
    8383            },
    84             "time": "2025-10-14T07:05:43+00:00",
     84            "time": "2026-01-14T10:02:49+00:00",
    8585            "type": "library",
    8686            "installation-source": "dist",
  • packlink-pro-shipping/trunk/vendor/composer/installed.php

    r3379500 r3440427  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '3.6.0',
    4         'version' => '3.6.0.0',
     3        'pretty_version' => '3.6.2',
     4        'version' => '3.6.2.0',
    55        'type' => 'library',
    66        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'packlink/integration-core' => array(
    23             'pretty_version' => 'v3.7.0',
    24             'version' => '3.7.0.0',
     23            'pretty_version' => 'v3.7.2',
     24            'version' => '3.7.2.0',
    2525            'type' => 'library',
    2626            'install_path' => __DIR__ . '/../packlink/integration-core',
    2727            'aliases' => array(),
    28             'reference' => 'fc2a9012e503fa4a1402eb377e7984c71c973d23',
     28            'reference' => '37f5a860a2e6fe4794e2e2b0e4424d7e7a682044',
    2929            'dev_requirement' => false,
    3030        ),
    3131        'packlink/woocommerce' => array(
    32             'pretty_version' => '3.6.0',
    33             'version' => '3.6.0.0',
     32            'pretty_version' => '3.6.2',
     33            'version' => '3.6.2.0',
    3434            'type' => 'library',
    3535            'install_path' => __DIR__ . '/../../',
  • packlink-pro-shipping/trunk/vendor/packlink/integration-core/CHANGELOG.md

    r3379500 r3440427  
    33
    44The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
     5
     6## [3.7.2](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.7.1...v3.7.2) - 2026-01-14
     7### Changed
     8- Add postal code for Lithuania
     9-
     10## [3.7.1](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.7.0...v3.7.1) - 2025-10-20
     11### Changed
     12- Add postal code for South Korea
    513
    614## [3.7.0](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.6.7...v3.7.0) - 2025-10-14
  • packlink-pro-shipping/trunk/vendor/packlink/integration-core/src/Brands/Packlink/PacklinkConfigurationService.php

    r3332993 r3440427  
    230230            'code' => 'MC',
    231231            'postal_code' => '98000',
     232        ),
     233        'KR' => array(
     234            'code' => 'KR',
     235            'postal_code' => '01000',
     236        ),
     237        'LT' => array(
     238            'code' => 'LT',
     239            'postal_code' => '01100',
    232240        ),
    233241    );
Note: See TracChangeset for help on using the changeset viewer.