Plugin Directory

Changeset 2929578


Ignore:
Timestamp:
06/22/2023 09:05:28 AM (3 years ago)
Author:
clearpayit
Message:

Release v3.5.4.

Location:
clearpay-gateway-for-woocommerce
Files:
152 added
1 deleted
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • clearpay-gateway-for-woocommerce/tags/3.5.4/build/clearpay-blocks.asset.php

    r2852675 r2929578  
    1 <?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '4724fb8c172d7cd1aa65e3bbe7046cfe');
     1<?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '2061bc48a5a547e6b5cfc40fe097c0c9');
  • clearpay-gateway-for-woocommerce/tags/3.5.4/build/clearpay-page-checkout.asset.php

    r2852675 r2929578  
    1 <?php return array('dependencies' => array(), 'version' => 'f297772b805e895c3c1207e8428548cb');
     1<?php return array('dependencies' => array(), 'version' => '0bee6c009c9fb1ef9213246f59e7018f');
  • clearpay-gateway-for-woocommerce/tags/3.5.4/class/WC_Gateway_Clearpay.php

    r2852675 r2929578  
    10841084                        foreach ($items as $item) {
    10851085                            if ($product = $item->get_product()) {
     1086                                $name = $product->get_name();
     1087                                $quantity = $item->get_quantity();
     1088                                $price = [ (float) $item->get_subtotal() / $quantity, $currency ];
     1089                                if ((fmod($quantity, 1) !== 0.00)) {
     1090                                    $name = $name . ' (' . $quantity . ')';
     1091                                    $price = [ (float) $item->get_subtotal(), $currency ];
     1092                                    $quantity = 1;
     1093                                }
    10861094                                $itemsData[] = [
    1087                                     'name' => $product->get_name(),
     1095                                    'name' => $name,
    10881096                                    'sku' => $product->get_sku(),
    1089                                     'quantity' => $item->get_quantity(),
    1090                                     'price' => [ (float) $item->get_subtotal() / $item->get_quantity(), $currency ]
     1097                                    'quantity' => intval($quantity),
     1098                                    'price' => $price
    10911099                                ];
    10921100                            }
     
    11791187
    11801188                        $order->payment_complete($payment->id);
    1181                         update_post_meta($order_id, '_transaction_url', $payment->merchantPortalOrderUrl);
     1189                        $order->update_meta_data('_transaction_url', $payment->merchantPortalOrderUrl);
     1190                        $order->save();
    11821191                        if (wp_redirect( $this->get_return_url($order) )) {
    11831192                            exit;
     
    12111220         */
    12121221        public function get_transaction_url($order) {
    1213             $url = get_post_meta($order->get_id(), '_transaction_url', true);
     1222            $url = $order->get_meta('_transaction_url');
    12141223            if (empty($url)) {
    12151224                try {
     
    14201429                            $product = wc_get_product($item['product_id']);
    14211430                        }
     1431                        $name = $product->get_name();
     1432                        $quantity = $item['quantity'];
     1433                        $price = [ wc_get_price_excluding_tax($product), $currency ];
     1434                        if ((fmod($quantity, 1) !== 0.00)) {
     1435                            $name = $name . ' (' . $quantity . ')';
     1436                            $price = [ number_format((float) wc_get_price_excluding_tax($product) * $quantity, 2, '.', ''), $currency ];
     1437                            $quantity = 1;
     1438                        }
    14221439                        $itemsData[] = [
    1423                             'name' => $product->get_name(),
     1440                            'name' => $name,
    14241441                            'sku' => $product->get_sku(),
    1425                             'quantity' => $item['quantity'],
    1426                             'price' => [ wc_get_price_excluding_tax($product), $currency ]
     1442                            'quantity' => intval($quantity),
     1443                            'price' => $price
    14271444                        ];
    14281445                    }
     
    18551872
    18561873                    $order->payment_complete($payment->id);
    1857                     update_post_meta($order->get_id(), '_transaction_url', $payment->merchantPortalOrderUrl);
     1874                    $order->update_meta_data('_transaction_url', $payment->merchantPortalOrderUrl);
     1875                    $order->save();
    18581876                } else {
    18591877                    $order->update_status('failed', sprintf(__('Payment declined. Clearpay Order ID: %s.', 'woo_clearpay'), $payment->id));
     
    19221940                    $product = wc_get_product($item['product_id']);
    19231941                }
     1942                $name = $product->get_name();
     1943                $quantity = $item['quantity'];
     1944                $price = number_format(wc_get_price_excluding_tax($product), 2, '.', '');
     1945                if ((fmod($quantity, 1) !== 0.00)) {
     1946                    $name = $name . ' (' . $quantity . ')';
     1947                    $price = number_format((float) wc_get_price_excluding_tax($product) * $quantity, 2, '.', '');
     1948                    $quantity = 1;
     1949                }
    19241950                $latest_cart['items'][] = array(
    1925                     'name' => $product->get_name(),
     1951                    'name' => $name,
    19261952                    'sku' => $product->get_sku(),
    1927                     'quantity' => $item['quantity'],
     1953                    'quantity' => intval($quantity),
    19281954                    'price' => array(
    1929                         'amount' => number_format(wc_get_price_excluding_tax($product), 2, '.', ''),
     1955                        'amount' => $price,
    19301956                        'currency' => $currency
    19311957                    )
  • clearpay-gateway-for-woocommerce/tags/3.5.4/clearpay-gateway-for-woocommerce.php

    r2852675 r2929578  
    55 * Author: Clearpay
    66 * Author URI: https://www.clearpay.co.uk/
    7  * Version: 3.5.3
     7 * Version: 3.5.4
    88 * Text Domain: woo_clearpay
    99 * Domain Path: /languages/
    1010 * WC requires at least: 3.2.6
    11  * WC tested up to: 7.3.0
     11 * WC tested up to: 7.8.0
    1212 *
    1313 * Copyright: (c) 2021 Clearpay
     
    4747         *                                          the value in the comments above.
    4848         */
    49         public static $version = '3.5.3';
     49        public static $version = '3.5.4';
    5050
    5151        /**
     
    420420    add_action( 'plugins_loaded', array('Clearpay_Plugin', 'init'), 10, 0 );
    421421    add_action( 'woocommerce_blocks_loaded', array('Clearpay_Plugin', 'add_woocommerce_blocks_support') );
     422    // Declare compatibility with custom order tables for WooCommerce.
     423    add_action( 'before_woocommerce_init', function() {
     424        if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
     425            \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
     426        }
     427    });
    422428}
  • clearpay-gateway-for-woocommerce/tags/3.5.4/readme.txt

    r2852675 r2929578  
    33Tags: woocommerce, clearpay
    44Requires at least: 4.8.3
    5 Tested up to: 6.1.1
    6 Stable tag: 3.5.3
     5Tested up to: 6.2.2
     6Stable tag: 3.5.4
    77License: GNU Public License
    88License URI: https://www.gnu.org/licenses/
     
    4040== Changelog ==
    4141
     42= 3.5.4 =
     43*Release Date: Thursday, 22 Jun 2023*
     44
     45* Added support for High-Performance Order Storage (HPOS).
     46* Added support for item decimal quantities.
     47* Tested and verified support for WordPress 6.2.2 and WooCommerce 7.8.0.
     48
    4249= 3.5.3 =
    4350*Release Date: Monday, 23 Jan 2023*
  • clearpay-gateway-for-woocommerce/trunk/build/clearpay-blocks.asset.php

    r2852675 r2929578  
    1 <?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '4724fb8c172d7cd1aa65e3bbe7046cfe');
     1<?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '2061bc48a5a547e6b5cfc40fe097c0c9');
  • clearpay-gateway-for-woocommerce/trunk/build/clearpay-page-checkout.asset.php

    r2852675 r2929578  
    1 <?php return array('dependencies' => array(), 'version' => 'f297772b805e895c3c1207e8428548cb');
     1<?php return array('dependencies' => array(), 'version' => '0bee6c009c9fb1ef9213246f59e7018f');
  • clearpay-gateway-for-woocommerce/trunk/class/WC_Gateway_Clearpay.php

    r2852675 r2929578  
    10841084                        foreach ($items as $item) {
    10851085                            if ($product = $item->get_product()) {
     1086                                $name = $product->get_name();
     1087                                $quantity = $item->get_quantity();
     1088                                $price = [ (float) $item->get_subtotal() / $quantity, $currency ];
     1089                                if ((fmod($quantity, 1) !== 0.00)) {
     1090                                    $name = $name . ' (' . $quantity . ')';
     1091                                    $price = [ (float) $item->get_subtotal(), $currency ];
     1092                                    $quantity = 1;
     1093                                }
    10861094                                $itemsData[] = [
    1087                                     'name' => $product->get_name(),
     1095                                    'name' => $name,
    10881096                                    'sku' => $product->get_sku(),
    1089                                     'quantity' => $item->get_quantity(),
    1090                                     'price' => [ (float) $item->get_subtotal() / $item->get_quantity(), $currency ]
     1097                                    'quantity' => intval($quantity),
     1098                                    'price' => $price
    10911099                                ];
    10921100                            }
     
    11791187
    11801188                        $order->payment_complete($payment->id);
    1181                         update_post_meta($order_id, '_transaction_url', $payment->merchantPortalOrderUrl);
     1189                        $order->update_meta_data('_transaction_url', $payment->merchantPortalOrderUrl);
     1190                        $order->save();
    11821191                        if (wp_redirect( $this->get_return_url($order) )) {
    11831192                            exit;
     
    12111220         */
    12121221        public function get_transaction_url($order) {
    1213             $url = get_post_meta($order->get_id(), '_transaction_url', true);
     1222            $url = $order->get_meta('_transaction_url');
    12141223            if (empty($url)) {
    12151224                try {
     
    14201429                            $product = wc_get_product($item['product_id']);
    14211430                        }
     1431                        $name = $product->get_name();
     1432                        $quantity = $item['quantity'];
     1433                        $price = [ wc_get_price_excluding_tax($product), $currency ];
     1434                        if ((fmod($quantity, 1) !== 0.00)) {
     1435                            $name = $name . ' (' . $quantity . ')';
     1436                            $price = [ number_format((float) wc_get_price_excluding_tax($product) * $quantity, 2, '.', ''), $currency ];
     1437                            $quantity = 1;
     1438                        }
    14221439                        $itemsData[] = [
    1423                             'name' => $product->get_name(),
     1440                            'name' => $name,
    14241441                            'sku' => $product->get_sku(),
    1425                             'quantity' => $item['quantity'],
    1426                             'price' => [ wc_get_price_excluding_tax($product), $currency ]
     1442                            'quantity' => intval($quantity),
     1443                            'price' => $price
    14271444                        ];
    14281445                    }
     
    18551872
    18561873                    $order->payment_complete($payment->id);
    1857                     update_post_meta($order->get_id(), '_transaction_url', $payment->merchantPortalOrderUrl);
     1874                    $order->update_meta_data('_transaction_url', $payment->merchantPortalOrderUrl);
     1875                    $order->save();
    18581876                } else {
    18591877                    $order->update_status('failed', sprintf(__('Payment declined. Clearpay Order ID: %s.', 'woo_clearpay'), $payment->id));
     
    19221940                    $product = wc_get_product($item['product_id']);
    19231941                }
     1942                $name = $product->get_name();
     1943                $quantity = $item['quantity'];
     1944                $price = number_format(wc_get_price_excluding_tax($product), 2, '.', '');
     1945                if ((fmod($quantity, 1) !== 0.00)) {
     1946                    $name = $name . ' (' . $quantity . ')';
     1947                    $price = number_format((float) wc_get_price_excluding_tax($product) * $quantity, 2, '.', '');
     1948                    $quantity = 1;
     1949                }
    19241950                $latest_cart['items'][] = array(
    1925                     'name' => $product->get_name(),
     1951                    'name' => $name,
    19261952                    'sku' => $product->get_sku(),
    1927                     'quantity' => $item['quantity'],
     1953                    'quantity' => intval($quantity),
    19281954                    'price' => array(
    1929                         'amount' => number_format(wc_get_price_excluding_tax($product), 2, '.', ''),
     1955                        'amount' => $price,
    19301956                        'currency' => $currency
    19311957                    )
  • clearpay-gateway-for-woocommerce/trunk/clearpay-gateway-for-woocommerce.php

    r2852675 r2929578  
    55 * Author: Clearpay
    66 * Author URI: https://www.clearpay.co.uk/
    7  * Version: 3.5.3
     7 * Version: 3.5.4
    88 * Text Domain: woo_clearpay
    99 * Domain Path: /languages/
    1010 * WC requires at least: 3.2.6
    11  * WC tested up to: 7.3.0
     11 * WC tested up to: 7.8.0
    1212 *
    1313 * Copyright: (c) 2021 Clearpay
     
    4747         *                                          the value in the comments above.
    4848         */
    49         public static $version = '3.5.3';
     49        public static $version = '3.5.4';
    5050
    5151        /**
     
    420420    add_action( 'plugins_loaded', array('Clearpay_Plugin', 'init'), 10, 0 );
    421421    add_action( 'woocommerce_blocks_loaded', array('Clearpay_Plugin', 'add_woocommerce_blocks_support') );
     422    // Declare compatibility with custom order tables for WooCommerce.
     423    add_action( 'before_woocommerce_init', function() {
     424        if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
     425            \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
     426        }
     427    });
    422428}
  • clearpay-gateway-for-woocommerce/trunk/readme.txt

    r2852675 r2929578  
    33Tags: woocommerce, clearpay
    44Requires at least: 4.8.3
    5 Tested up to: 6.1.1
    6 Stable tag: 3.5.3
     5Tested up to: 6.2.2
     6Stable tag: 3.5.4
    77License: GNU Public License
    88License URI: https://www.gnu.org/licenses/
     
    4040== Changelog ==
    4141
     42= 3.5.4 =
     43*Release Date: Thursday, 22 Jun 2023*
     44
     45* Added support for High-Performance Order Storage (HPOS).
     46* Added support for item decimal quantities.
     47* Tested and verified support for WordPress 6.2.2 and WooCommerce 7.8.0.
     48
    4249= 3.5.3 =
    4350*Release Date: Monday, 23 Jan 2023*
Note: See TracChangeset for help on using the changeset viewer.