Plugin Directory

Changeset 2995309


Ignore:
Timestamp:
11/13/2023 04:24:43 PM (2 years ago)
Author:
multisafepayplugin
Message:

Update to version 6.2.0 from GitHub

Location:
multisafepay
Files:
4 added
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • multisafepay/tags/6.2.0/multisafepay.php

    r2981071 r2995309  
    55 * Plugin URI:              https://docs.multisafepay.com/docs/woocommerce
    66 * Description:             MultiSafepay Payment Plugin
    7  * Version:                 6.1.2
     7 * Version:                 6.2.0
    88 * Author:                  MultiSafepay
    99 * Author URI:              https://www.multisafepay.com
     
    1212 * License URI:             http://www.gnu.org/licenses/gpl-3.0.html
    1313 * Requires at least:       6.0
    14  * Tested up to:            6.3.1
     14 * Tested up to:            6.4.1
    1515 * WC requires at least:    6.0.0
    16  * WC tested up to:         8.2.1
     16 * WC tested up to:         8.2.2
    1717 * Requires PHP:            7.3
    1818 * Text Domain:             multisafepay
     
    2727 * Plugin version
    2828 */
    29 define( 'MULTISAFEPAY_PLUGIN_VERSION', '6.1.2' );
     29define( 'MULTISAFEPAY_PLUGIN_VERSION', '6.2.0' );
    3030
    3131/**
  • multisafepay/tags/6.2.0/readme.txt

    r2981071 r2995309  
    33Tags: multisafepay, credit card, credit cards, gateway, payments, woocommerce, ideal, bancontact, klarna, sofort, giropay, sepa direct debit
    44Requires at least: 6.0
    5 Tested up to: 6.3.1
     5Tested up to: 6.4.1
    66Requires PHP: 7.3
    7 Stable tag: 6.1.2
     7Stable tag: 6.2.0
    88License: MIT
    99
     
    128128== Upgrade Notice ==
    129129
    130 = 6.1.2 =
     130= 6.2.0 =
    1311316.x.x is a major upgrade in which the MultiSafepay payment methods are registered dynamically via an API request to MultiSafepay. If you are upgrading from 5.X.X version, after the upgrade, please navigate to the MultiSafepay settings page, and to each one of the payment methods enabled in your account, and confirm the settings in each section are set up according to your preferences.
    132132
     
    144144
    145145== Changelog ==
     146= Release Notes - WooCommerce 6.2.0 (Nov 13th, 2023) =
     147
     148### Added
     149+ PLGWOOS-872: Add support for [High-Performance Order Storage](https://woo.com/document/high-performance-order-storage/)
     150
    146151= Release Notes - WooCommerce 6.1.2 (Oct 19th, 2023) =
    147152
  • multisafepay/tags/6.2.0/src/Main.php

    r2974626 r2995309  
    66use MultiSafepay\WooCommerce\PaymentMethods\PaymentMethodsController;
    77use MultiSafepay\WooCommerce\Settings\SettingsController;
     8use MultiSafepay\WooCommerce\Settings\ThirdPartyCompatibility;
    89use MultiSafepay\WooCommerce\Utils\CustomLinks;
    910use MultiSafepay\WooCommerce\Utils\Internationalization;
     
    3637        $this->define_settings_hooks();
    3738        $this->define_payment_methods_hooks();
     39        $this->define_compatibilities();
    3840    }
    3941
     
    6466    }
    6567
     68    /**
     69     * Define compatibilities with third party plugins
     70     *
     71     * @return void
     72     */
     73    private function define_compatibilities(): void {
     74        $compatibilities = new ThirdPartyCompatibility();
     75        $this->loader->add_action( 'before_woocommerce_init', $compatibilities, 'declare_hpos_compatibility' );
     76    }
    6677
    6778    /**
  • multisafepay/tags/6.2.0/src/PaymentMethods/Base/BaseRefunds.php

    r2974626 r2995309  
    2626     *
    2727     * @return  mixed boolean|WP_Error
     28     *
     29     * @throws ClientExceptionInterface
    2830     */
    2931    public function process_refund( $order_id, $amount = null, $reason = '' ) {
     
    5153        $refund_request->addDescriptionText( $reason );
    5254
    53         // If the used gateway is a billing suite gateway, or the generic requiring shopping cart, create the refund based on items
    54         if (
    55             (bool) get_post_meta( $order->get_id(), 'order_require_shopping_cart', true ) ||
    56             $multisafepay_transaction->requiresShoppingCart()
    57         ) {
    58 
     55        if ( $multisafepay_transaction->requiresShoppingCart() ) {
    5956            $refunds                 = $order->get_refunds();
    6057            $refund_merchant_item_id = reset( $refunds )->id;
  • multisafepay/tags/6.2.0/src/PaymentMethods/PaymentMethodCallback.php

    r2981071 r2995309  
    1111use MultiSafepay\WooCommerce\Utils\Logger;
    1212use Psr\Http\Client\ClientExceptionInterface;
     13use WC_Data_Exception;
    1314use WC_Order;
    1415
     
    185186     *
    186187     * @return void
     188     * @throws WC_Data_Exception
    187189     */
    188190    public function process_callback(): void {
     
    233235        $default_order_status                             = SettingsFields::get_multisafepay_order_statuses();
    234236
    235         // If the payment method changed in MultiSafepay payment page, after leave WooCommerce checkout page
    236         if ( $payment_method_id_registered_by_multisafepay && $payment_method_id_registered_by_wc !== $payment_method_id_registered_by_multisafepay ) {
    237             if ( get_option( 'multisafepay_debugmode', false ) ) {
    238                 $message = 'Callback received with a different payment method for Order ID: ' . $this->woocommerce_order_id . ' and Order Number: ' . $this->multisafepay_order_id . ' on ' . $this->time_stamp . '. Payment method changed from ' . $payment_method_title_registered_by_wc . ' to ' . $payment_method_title_registered_by_multisafepay . '.';
    239                 Logger::log_info( $message );
    240                 $this->order->add_order_note( $message );
    241             }
    242             update_post_meta( $this->woocommerce_order_id, '_payment_method', $payment_method_id_registered_by_multisafepay );
    243             update_post_meta( $this->woocommerce_order_id, '_payment_method_title', $payment_method_title_registered_by_multisafepay );
    244         }
    245 
    246237        // Check if the WooCommerce Order status do not match with the order status received in notification, to avoid to process repeated of notification.
    247238        // Or if the custom initial order status of the gateway is different than the general one, and the MultiSafepay transaction status is initialized, and custom initial order status is different than the current WooCommerce order status
     
    282273        }
    283274
     275        // If the payment method changed in MultiSafepay payment page, after leave WooCommerce checkout page
     276        if ( $payment_method_id_registered_by_multisafepay && $payment_method_id_registered_by_wc !== $payment_method_id_registered_by_multisafepay ) {
     277            if ( get_option( 'multisafepay_debugmode', false ) ) {
     278                $message = 'Callback received with a different payment method for Order ID: ' . $this->woocommerce_order_id . ' and Order Number: ' . $this->multisafepay_order_id . ' on ' . $this->time_stamp . '. Payment method changed from ' . $payment_method_title_registered_by_wc . ' to ' . $payment_method_title_registered_by_multisafepay . '.';
     279                Logger::log_info( $message );
     280                $this->order->add_order_note( $message );
     281            }
     282
     283            $this->order = wc_get_order( $this->woocommerce_order_id );
     284            $this->order->set_payment_method( $registered_by_multisafepay_payment_method_object );
     285            $this->order->save();
     286        }
     287
    284288        header( 'Content-type: text/plain' );
    285289        die( 'OK' );
  • multisafepay/tags/6.2.0/src/PaymentMethods/PaymentMethodsController.php

    r2974626 r2995309  
    1111use MultiSafepay\WooCommerce\Services\PaymentMethodService;
    1212use MultiSafepay\WooCommerce\Services\SdkService;
     13use MultiSafepay\WooCommerce\Utils\Hpos;
    1314use MultiSafepay\WooCommerce\Utils\Logger;
    1415use Psr\Http\Client\ClientExceptionInterface;
     
    212213     * Takes an order generated in admin and pass the data to MultiSafepay to process the order request.
    213214     *
    214      * @param   int $order_id
    215      * @return  void
     215     * @param  int $order_id
     216     *
     217     * @return void
     218     * @throws ClientExceptionInterface
    216219     */
    217220    public function generate_orders_from_backend( int $order_id ): void {
     
    243246
    244247        if ( $transaction->getPaymentUrl() ) {
    245             // Update order meta data with the payment link
    246             update_post_meta( $order_id, 'payment_url', $transaction->getPaymentUrl() );
    247             update_post_meta( $order_id, 'send_payment_link', '1' );
     248            // Update order metadata with the payment link
     249            Hpos::update_meta( $order, 'payment_url', $transaction->getPaymentUrl() );
     250            Hpos::update_meta( $order, 'send_payment_link', '1' );
    248251
    249252            if ( get_option( 'multisafepay_debugmode', false ) ) {
     
    258261     * @param string   $default_payment_link
    259262     * @param WC_Order $order
     263     *
     264     * @return mixed|string
    260265     */
    261266    public function replace_checkout_payment_url( string $default_payment_link, WC_Order $order ) {
    262         $send_payment_link = get_post_meta( $order->get_id(), 'send_payment_link', true );
     267        $send_payment_link = Hpos::get_meta( $order, 'send_payment_link' );
    263268        if ( $send_payment_link ) {
    264             return get_post_meta( $order->get_id(), 'payment_url', true );
    265         }
    266 
     269            return Hpos::get_meta( $order, 'payment_url' );
     270        }
    267271        return $default_payment_link;
    268272    }
  • multisafepay/tags/6.2.0/src/Services/ShoppingCartService.php

    r2974626 r2995309  
    66use MultiSafepay\Api\Transactions\OrderRequest\Arguments\ShoppingCart\Item as CartItem;
    77use MultiSafepay\Api\Transactions\OrderRequest\Arguments\ShoppingCart\ShippingItem;
     8use MultiSafepay\WooCommerce\Utils\Hpos;
    89use MultiSafepay\WooCommerce\Utils\Logger;
    910use MultiSafepay\WooCommerce\Utils\MoneyUtil;
     
    120121        }
    121122
    122         if ( $this->is_order_vat_exempt( $item->get_order_id() ) ) {
     123        if ( $this->is_order_vat_exempt( $item->get_order() ) ) {
    123124            return 0;
    124125        }
     
    164165        }
    165166
    166         if ( $this->is_order_vat_exempt( $item->get_order_id() ) ) {
     167        if ( $this->is_order_vat_exempt( $item->get_order() ) ) {
    167168            return 0;
    168169        }
     
    206207        }
    207208
    208         if ( $this->is_order_vat_exempt( $item->get_order_id() ) ) {
     209        if ( $this->is_order_vat_exempt( $item->get_order() ) ) {
    209210            return 0;
    210211        }
     
    228229     * Returns if order is VAT exempt via WC->Customer->is_vat_exempt
    229230     *
    230      * @param int $order_id
     231     * @param WC_Order $order
    231232     * @return boolean
    232233     */
    233     private function is_order_vat_exempt( int $order_id ): bool {
    234         if ( get_post_meta( $order_id, 'is_vat_exempt', true ) === 'yes' ) {
    235             return true;
    236         }
    237         return false;
     234    public function is_order_vat_exempt( WC_Order $order ): bool {
     235        return Hpos::get_meta( $order, 'is_vat_exempt' ) === 'yes';
    238236    }
    239237
  • multisafepay/tags/6.2.0/vendor/composer/installed.json

    r2979525 r2995309  
    5959        {
    6060            "name": "nyholm/psr7",
    61             "version": "1.8.0",
    62             "version_normalized": "1.8.0.0",
     61            "version": "1.8.1",
     62            "version_normalized": "1.8.1.0",
    6363            "source": {
    6464                "type": "git",
    6565                "url": "https://github.com/Nyholm/psr7.git",
    66                 "reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be"
    67             },
    68             "dist": {
    69                 "type": "zip",
    70                 "url": "https://api.github.com/repos/Nyholm/psr7/zipball/3cb4d163b58589e47b35103e8e5e6a6a475b47be",
    71                 "reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be",
     66                "reference": "aa5fc277a4f5508013d571341ade0c3886d4d00e"
     67            },
     68            "dist": {
     69                "type": "zip",
     70                "url": "https://api.github.com/repos/Nyholm/psr7/zipball/aa5fc277a4f5508013d571341ade0c3886d4d00e",
     71                "reference": "aa5fc277a4f5508013d571341ade0c3886d4d00e",
    7272                "shasum": ""
    7373            },
     
    8989                "symfony/error-handler": "^4.4"
    9090            },
    91             "time": "2023-05-02T11:26:24+00:00",
     91            "time": "2023-11-13T09:31:12+00:00",
    9292            "type": "library",
    9393            "extra": {
     
    124124            "support": {
    125125                "issues": "https://github.com/Nyholm/psr7/issues",
    126                 "source": "https://github.com/Nyholm/psr7/tree/1.8.0"
     126                "source": "https://github.com/Nyholm/psr7/tree/1.8.1"
    127127            },
    128128            "funding": [
  • multisafepay/tags/6.2.0/vendor/composer/installed.php

    r2981071 r2995309  
    22    'root' => array(
    33        'name' => 'multisafepay/woocommerce',
    4         'pretty_version' => '6.1.2',
    5         'version' => '6.1.2.0',
    6         'reference' => '86dc85f0c559e73d73bcd3491cf5fab269e39733',
     4        'pretty_version' => '6.2.0',
     5        'version' => '6.2.0.0',
     6        'reference' => '0cd97a2041ea998b282fe44d7f7766c90634842f',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'multisafepay/woocommerce' => array(
    23             'pretty_version' => '6.1.2',
    24             'version' => '6.1.2.0',
    25             'reference' => '86dc85f0c559e73d73bcd3491cf5fab269e39733',
     23            'pretty_version' => '6.2.0',
     24            'version' => '6.2.0.0',
     25            'reference' => '0cd97a2041ea998b282fe44d7f7766c90634842f',
    2626            'type' => 'wordpress-plugin',
    2727            'install_path' => __DIR__ . '/../../',
     
    3030        ),
    3131        'nyholm/psr7' => array(
    32             'pretty_version' => '1.8.0',
    33             'version' => '1.8.0.0',
    34             'reference' => '3cb4d163b58589e47b35103e8e5e6a6a475b47be',
     32            'pretty_version' => '1.8.1',
     33            'version' => '1.8.1.0',
     34            'reference' => 'aa5fc277a4f5508013d571341ade0c3886d4d00e',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../nyholm/psr7',
  • multisafepay/tags/6.2.0/vendor/nyholm/psr7/src/Stream.php

    r2927749 r2995309  
    261261        }
    262262
    263         if (false === $contents = @\stream_get_contents($this->stream)) {
    264             throw new \RuntimeException('Unable to read stream contents: ' . (\error_get_last()['message'] ?? ''));
    265         }
    266 
    267         return $contents;
     263        $exception = null;
     264
     265        \set_error_handler(static function ($type, $message) use (&$exception) {
     266            throw $exception = new \RuntimeException('Unable to read stream contents: ' . $message);
     267        });
     268
     269        try {
     270            return \stream_get_contents($this->stream);
     271        } catch (\Throwable $e) {
     272            throw $e === $exception ? $e : new \RuntimeException('Unable to read stream contents: ' . $e->getMessage(), 0, $e);
     273        } finally {
     274            \restore_error_handler();
     275        }
    268276    }
    269277
  • multisafepay/trunk/multisafepay.php

    r2981071 r2995309  
    55 * Plugin URI:              https://docs.multisafepay.com/docs/woocommerce
    66 * Description:             MultiSafepay Payment Plugin
    7  * Version:                 6.1.2
     7 * Version:                 6.2.0
    88 * Author:                  MultiSafepay
    99 * Author URI:              https://www.multisafepay.com
     
    1212 * License URI:             http://www.gnu.org/licenses/gpl-3.0.html
    1313 * Requires at least:       6.0
    14  * Tested up to:            6.3.1
     14 * Tested up to:            6.4.1
    1515 * WC requires at least:    6.0.0
    16  * WC tested up to:         8.2.1
     16 * WC tested up to:         8.2.2
    1717 * Requires PHP:            7.3
    1818 * Text Domain:             multisafepay
     
    2727 * Plugin version
    2828 */
    29 define( 'MULTISAFEPAY_PLUGIN_VERSION', '6.1.2' );
     29define( 'MULTISAFEPAY_PLUGIN_VERSION', '6.2.0' );
    3030
    3131/**
  • multisafepay/trunk/readme.txt

    r2981071 r2995309  
    33Tags: multisafepay, credit card, credit cards, gateway, payments, woocommerce, ideal, bancontact, klarna, sofort, giropay, sepa direct debit
    44Requires at least: 6.0
    5 Tested up to: 6.3.1
     5Tested up to: 6.4.1
    66Requires PHP: 7.3
    7 Stable tag: 6.1.2
     7Stable tag: 6.2.0
    88License: MIT
    99
     
    128128== Upgrade Notice ==
    129129
    130 = 6.1.2 =
     130= 6.2.0 =
    1311316.x.x is a major upgrade in which the MultiSafepay payment methods are registered dynamically via an API request to MultiSafepay. If you are upgrading from 5.X.X version, after the upgrade, please navigate to the MultiSafepay settings page, and to each one of the payment methods enabled in your account, and confirm the settings in each section are set up according to your preferences.
    132132
     
    144144
    145145== Changelog ==
     146= Release Notes - WooCommerce 6.2.0 (Nov 13th, 2023) =
     147
     148### Added
     149+ PLGWOOS-872: Add support for [High-Performance Order Storage](https://woo.com/document/high-performance-order-storage/)
     150
    146151= Release Notes - WooCommerce 6.1.2 (Oct 19th, 2023) =
    147152
  • multisafepay/trunk/src/Main.php

    r2974626 r2995309  
    66use MultiSafepay\WooCommerce\PaymentMethods\PaymentMethodsController;
    77use MultiSafepay\WooCommerce\Settings\SettingsController;
     8use MultiSafepay\WooCommerce\Settings\ThirdPartyCompatibility;
    89use MultiSafepay\WooCommerce\Utils\CustomLinks;
    910use MultiSafepay\WooCommerce\Utils\Internationalization;
     
    3637        $this->define_settings_hooks();
    3738        $this->define_payment_methods_hooks();
     39        $this->define_compatibilities();
    3840    }
    3941
     
    6466    }
    6567
     68    /**
     69     * Define compatibilities with third party plugins
     70     *
     71     * @return void
     72     */
     73    private function define_compatibilities(): void {
     74        $compatibilities = new ThirdPartyCompatibility();
     75        $this->loader->add_action( 'before_woocommerce_init', $compatibilities, 'declare_hpos_compatibility' );
     76    }
    6677
    6778    /**
  • multisafepay/trunk/src/PaymentMethods/Base/BaseRefunds.php

    r2974626 r2995309  
    2626     *
    2727     * @return  mixed boolean|WP_Error
     28     *
     29     * @throws ClientExceptionInterface
    2830     */
    2931    public function process_refund( $order_id, $amount = null, $reason = '' ) {
     
    5153        $refund_request->addDescriptionText( $reason );
    5254
    53         // If the used gateway is a billing suite gateway, or the generic requiring shopping cart, create the refund based on items
    54         if (
    55             (bool) get_post_meta( $order->get_id(), 'order_require_shopping_cart', true ) ||
    56             $multisafepay_transaction->requiresShoppingCart()
    57         ) {
    58 
     55        if ( $multisafepay_transaction->requiresShoppingCart() ) {
    5956            $refunds                 = $order->get_refunds();
    6057            $refund_merchant_item_id = reset( $refunds )->id;
  • multisafepay/trunk/src/PaymentMethods/PaymentMethodCallback.php

    r2981071 r2995309  
    1111use MultiSafepay\WooCommerce\Utils\Logger;
    1212use Psr\Http\Client\ClientExceptionInterface;
     13use WC_Data_Exception;
    1314use WC_Order;
    1415
     
    185186     *
    186187     * @return void
     188     * @throws WC_Data_Exception
    187189     */
    188190    public function process_callback(): void {
     
    233235        $default_order_status                             = SettingsFields::get_multisafepay_order_statuses();
    234236
    235         // If the payment method changed in MultiSafepay payment page, after leave WooCommerce checkout page
    236         if ( $payment_method_id_registered_by_multisafepay && $payment_method_id_registered_by_wc !== $payment_method_id_registered_by_multisafepay ) {
    237             if ( get_option( 'multisafepay_debugmode', false ) ) {
    238                 $message = 'Callback received with a different payment method for Order ID: ' . $this->woocommerce_order_id . ' and Order Number: ' . $this->multisafepay_order_id . ' on ' . $this->time_stamp . '. Payment method changed from ' . $payment_method_title_registered_by_wc . ' to ' . $payment_method_title_registered_by_multisafepay . '.';
    239                 Logger::log_info( $message );
    240                 $this->order->add_order_note( $message );
    241             }
    242             update_post_meta( $this->woocommerce_order_id, '_payment_method', $payment_method_id_registered_by_multisafepay );
    243             update_post_meta( $this->woocommerce_order_id, '_payment_method_title', $payment_method_title_registered_by_multisafepay );
    244         }
    245 
    246237        // Check if the WooCommerce Order status do not match with the order status received in notification, to avoid to process repeated of notification.
    247238        // Or if the custom initial order status of the gateway is different than the general one, and the MultiSafepay transaction status is initialized, and custom initial order status is different than the current WooCommerce order status
     
    282273        }
    283274
     275        // If the payment method changed in MultiSafepay payment page, after leave WooCommerce checkout page
     276        if ( $payment_method_id_registered_by_multisafepay && $payment_method_id_registered_by_wc !== $payment_method_id_registered_by_multisafepay ) {
     277            if ( get_option( 'multisafepay_debugmode', false ) ) {
     278                $message = 'Callback received with a different payment method for Order ID: ' . $this->woocommerce_order_id . ' and Order Number: ' . $this->multisafepay_order_id . ' on ' . $this->time_stamp . '. Payment method changed from ' . $payment_method_title_registered_by_wc . ' to ' . $payment_method_title_registered_by_multisafepay . '.';
     279                Logger::log_info( $message );
     280                $this->order->add_order_note( $message );
     281            }
     282
     283            $this->order = wc_get_order( $this->woocommerce_order_id );
     284            $this->order->set_payment_method( $registered_by_multisafepay_payment_method_object );
     285            $this->order->save();
     286        }
     287
    284288        header( 'Content-type: text/plain' );
    285289        die( 'OK' );
  • multisafepay/trunk/src/PaymentMethods/PaymentMethodsController.php

    r2974626 r2995309  
    1111use MultiSafepay\WooCommerce\Services\PaymentMethodService;
    1212use MultiSafepay\WooCommerce\Services\SdkService;
     13use MultiSafepay\WooCommerce\Utils\Hpos;
    1314use MultiSafepay\WooCommerce\Utils\Logger;
    1415use Psr\Http\Client\ClientExceptionInterface;
     
    212213     * Takes an order generated in admin and pass the data to MultiSafepay to process the order request.
    213214     *
    214      * @param   int $order_id
    215      * @return  void
     215     * @param  int $order_id
     216     *
     217     * @return void
     218     * @throws ClientExceptionInterface
    216219     */
    217220    public function generate_orders_from_backend( int $order_id ): void {
     
    243246
    244247        if ( $transaction->getPaymentUrl() ) {
    245             // Update order meta data with the payment link
    246             update_post_meta( $order_id, 'payment_url', $transaction->getPaymentUrl() );
    247             update_post_meta( $order_id, 'send_payment_link', '1' );
     248            // Update order metadata with the payment link
     249            Hpos::update_meta( $order, 'payment_url', $transaction->getPaymentUrl() );
     250            Hpos::update_meta( $order, 'send_payment_link', '1' );
    248251
    249252            if ( get_option( 'multisafepay_debugmode', false ) ) {
     
    258261     * @param string   $default_payment_link
    259262     * @param WC_Order $order
     263     *
     264     * @return mixed|string
    260265     */
    261266    public function replace_checkout_payment_url( string $default_payment_link, WC_Order $order ) {
    262         $send_payment_link = get_post_meta( $order->get_id(), 'send_payment_link', true );
     267        $send_payment_link = Hpos::get_meta( $order, 'send_payment_link' );
    263268        if ( $send_payment_link ) {
    264             return get_post_meta( $order->get_id(), 'payment_url', true );
    265         }
    266 
     269            return Hpos::get_meta( $order, 'payment_url' );
     270        }
    267271        return $default_payment_link;
    268272    }
  • multisafepay/trunk/src/Services/ShoppingCartService.php

    r2974626 r2995309  
    66use MultiSafepay\Api\Transactions\OrderRequest\Arguments\ShoppingCart\Item as CartItem;
    77use MultiSafepay\Api\Transactions\OrderRequest\Arguments\ShoppingCart\ShippingItem;
     8use MultiSafepay\WooCommerce\Utils\Hpos;
    89use MultiSafepay\WooCommerce\Utils\Logger;
    910use MultiSafepay\WooCommerce\Utils\MoneyUtil;
     
    120121        }
    121122
    122         if ( $this->is_order_vat_exempt( $item->get_order_id() ) ) {
     123        if ( $this->is_order_vat_exempt( $item->get_order() ) ) {
    123124            return 0;
    124125        }
     
    164165        }
    165166
    166         if ( $this->is_order_vat_exempt( $item->get_order_id() ) ) {
     167        if ( $this->is_order_vat_exempt( $item->get_order() ) ) {
    167168            return 0;
    168169        }
     
    206207        }
    207208
    208         if ( $this->is_order_vat_exempt( $item->get_order_id() ) ) {
     209        if ( $this->is_order_vat_exempt( $item->get_order() ) ) {
    209210            return 0;
    210211        }
     
    228229     * Returns if order is VAT exempt via WC->Customer->is_vat_exempt
    229230     *
    230      * @param int $order_id
     231     * @param WC_Order $order
    231232     * @return boolean
    232233     */
    233     private function is_order_vat_exempt( int $order_id ): bool {
    234         if ( get_post_meta( $order_id, 'is_vat_exempt', true ) === 'yes' ) {
    235             return true;
    236         }
    237         return false;
     234    public function is_order_vat_exempt( WC_Order $order ): bool {
     235        return Hpos::get_meta( $order, 'is_vat_exempt' ) === 'yes';
    238236    }
    239237
  • multisafepay/trunk/vendor/composer/installed.json

    r2979525 r2995309  
    5959        {
    6060            "name": "nyholm/psr7",
    61             "version": "1.8.0",
    62             "version_normalized": "1.8.0.0",
     61            "version": "1.8.1",
     62            "version_normalized": "1.8.1.0",
    6363            "source": {
    6464                "type": "git",
    6565                "url": "https://github.com/Nyholm/psr7.git",
    66                 "reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be"
    67             },
    68             "dist": {
    69                 "type": "zip",
    70                 "url": "https://api.github.com/repos/Nyholm/psr7/zipball/3cb4d163b58589e47b35103e8e5e6a6a475b47be",
    71                 "reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be",
     66                "reference": "aa5fc277a4f5508013d571341ade0c3886d4d00e"
     67            },
     68            "dist": {
     69                "type": "zip",
     70                "url": "https://api.github.com/repos/Nyholm/psr7/zipball/aa5fc277a4f5508013d571341ade0c3886d4d00e",
     71                "reference": "aa5fc277a4f5508013d571341ade0c3886d4d00e",
    7272                "shasum": ""
    7373            },
     
    8989                "symfony/error-handler": "^4.4"
    9090            },
    91             "time": "2023-05-02T11:26:24+00:00",
     91            "time": "2023-11-13T09:31:12+00:00",
    9292            "type": "library",
    9393            "extra": {
     
    124124            "support": {
    125125                "issues": "https://github.com/Nyholm/psr7/issues",
    126                 "source": "https://github.com/Nyholm/psr7/tree/1.8.0"
     126                "source": "https://github.com/Nyholm/psr7/tree/1.8.1"
    127127            },
    128128            "funding": [
  • multisafepay/trunk/vendor/composer/installed.php

    r2981071 r2995309  
    22    'root' => array(
    33        'name' => 'multisafepay/woocommerce',
    4         'pretty_version' => '6.1.2',
    5         'version' => '6.1.2.0',
    6         'reference' => '86dc85f0c559e73d73bcd3491cf5fab269e39733',
     4        'pretty_version' => '6.2.0',
     5        'version' => '6.2.0.0',
     6        'reference' => '0cd97a2041ea998b282fe44d7f7766c90634842f',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'multisafepay/woocommerce' => array(
    23             'pretty_version' => '6.1.2',
    24             'version' => '6.1.2.0',
    25             'reference' => '86dc85f0c559e73d73bcd3491cf5fab269e39733',
     23            'pretty_version' => '6.2.0',
     24            'version' => '6.2.0.0',
     25            'reference' => '0cd97a2041ea998b282fe44d7f7766c90634842f',
    2626            'type' => 'wordpress-plugin',
    2727            'install_path' => __DIR__ . '/../../',
     
    3030        ),
    3131        'nyholm/psr7' => array(
    32             'pretty_version' => '1.8.0',
    33             'version' => '1.8.0.0',
    34             'reference' => '3cb4d163b58589e47b35103e8e5e6a6a475b47be',
     32            'pretty_version' => '1.8.1',
     33            'version' => '1.8.1.0',
     34            'reference' => 'aa5fc277a4f5508013d571341ade0c3886d4d00e',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../nyholm/psr7',
  • multisafepay/trunk/vendor/nyholm/psr7/src/Stream.php

    r2927749 r2995309  
    261261        }
    262262
    263         if (false === $contents = @\stream_get_contents($this->stream)) {
    264             throw new \RuntimeException('Unable to read stream contents: ' . (\error_get_last()['message'] ?? ''));
    265         }
    266 
    267         return $contents;
     263        $exception = null;
     264
     265        \set_error_handler(static function ($type, $message) use (&$exception) {
     266            throw $exception = new \RuntimeException('Unable to read stream contents: ' . $message);
     267        });
     268
     269        try {
     270            return \stream_get_contents($this->stream);
     271        } catch (\Throwable $e) {
     272            throw $e === $exception ? $e : new \RuntimeException('Unable to read stream contents: ' . $e->getMessage(), 0, $e);
     273        } finally {
     274            \restore_error_handler();
     275        }
    268276    }
    269277
Note: See TracChangeset for help on using the changeset viewer.