Plugin Directory

Changeset 2929579


Ignore:
Timestamp:
06/22/2023 09:07:51 AM (3 years ago)
Author:
afterpayit
Message:

Release v3.5.4.

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

Legend:

Unmodified
Added
Removed
  • afterpay-gateway-for-woocommerce/tags/3.5.4/afterpay-gateway-for-woocommerce.php

    r2852674 r2929579  
    55 * Author: Afterpay
    66 * Author URI: https://www.afterpay.com/
    7  * Version: 3.5.3
     7 * Version: 3.5.4
    88 * Text Domain: afterpay-gateway-for-woocommerce
    99 * WC requires at least: 3.2.6
    10  * WC tested up to: 7.3.0
     10 * WC tested up to: 7.8.0
    1111 *
    1212 * Copyright: (c) 2020 Afterpay
     
    4646         *                                          the value in the comments above.
    4747         */
    48         public static $version = '3.5.3';
     48        public static $version = '3.5.4';
    4949
    5050        /**
     
    416416    add_action( 'plugins_loaded', array('Afterpay_Plugin', 'init'), 10, 0 );
    417417    add_action( 'woocommerce_blocks_loaded', array('Afterpay_Plugin', 'add_woocommerce_blocks_support') );
     418    // Declare compatibility with custom order tables for WooCommerce.
     419    add_action( 'before_woocommerce_init', function() {
     420            if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
     421                \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
     422            }
     423        }
     424    );
    418425}
  • afterpay-gateway-for-woocommerce/tags/3.5.4/build/afterpay-blocks.asset.php

    r2852674 r2929579  
    1 <?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'd38778937a5ede934c4a96ec222e2652');
     1<?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '369fa1347fe714af4a8940ee39041733');
  • afterpay-gateway-for-woocommerce/tags/3.5.4/build/afterpay-page-checkout.asset.php

    r2852674 r2929579  
    1 <?php return array('dependencies' => array(), 'version' => 'ed96315bede061adca0042e12ec7f2f9');
     1<?php return array('dependencies' => array(), 'version' => 'f3029f05748f1d0fbba70e15363fe049');
  • afterpay-gateway-for-woocommerce/tags/3.5.4/class/WC_Gateway_Afterpay.php

    r2852674 r2929579  
    10801080                        foreach ($items as $item) {
    10811081                            if ($product = $item->get_product()) {
     1082                                $name = $product->get_name();
     1083                                $quantity = $item->get_quantity();
     1084                                $price = [ (float) $item->get_subtotal() / $quantity, $currency ];
     1085                                if ((fmod($quantity, 1) !== 0.00)) {
     1086                                    $name = $name . ' (' . $quantity . ')';
     1087                                    $price = [ (float) $item->get_subtotal(), $currency ];
     1088                                    $quantity = 1;
     1089                                }
    10821090                                $itemsData[] = [
    1083                                     'name' => $product->get_name(),
     1091                                    'name' => $name,
    10841092                                    'sku' => $product->get_sku(),
    1085                                     'quantity' => $item->get_quantity(),
    1086                                     'price' => [ (float) $item->get_subtotal() / $item->get_quantity(), $currency ]
     1093                                    'quantity' => intval($quantity),
     1094                                    'price' => $price
    10871095                                ];
    10881096                            }
     
    11751183
    11761184                        $order->payment_complete($payment->id);
    1177                         update_post_meta($order_id, '_transaction_url', $payment->merchantPortalOrderUrl);
     1185                        $order->update_meta_data('_transaction_url', $payment->merchantPortalOrderUrl);
     1186                        $order->save();
    11781187                        if (wp_redirect( $this->get_return_url($order) )) {
    11791188                            exit;
     
    12071216         */
    12081217        public function get_transaction_url($order) {
    1209             $url = get_post_meta($order->get_id(), '_transaction_url', true);
     1218            $url = $order->get_meta('_transaction_url');
    12101219            if (empty($url)) {
    12111220                try {
     
    14161425                            $product = wc_get_product($item['product_id']);
    14171426                        }
     1427                        $name = $product->get_name();
     1428                        $quantity = $item['quantity'];
     1429                        $price = [ wc_get_price_excluding_tax($product), $currency ];
     1430                        if ((fmod($quantity, 1) !== 0.00)) {
     1431                            $name = $name . ' (' . $quantity . ')';
     1432                            $price = [ number_format((float) wc_get_price_excluding_tax($product) * $quantity, 2, '.', ''), $currency ];
     1433                            $quantity = 1;
     1434                        }
    14181435                        $itemsData[] = [
    1419                             'name' => $product->get_name(),
     1436                            'name' => $name,
    14201437                            'sku' => $product->get_sku(),
    1421                             'quantity' => $item['quantity'],
    1422                             'price' => [ wc_get_price_excluding_tax($product), $currency ]
     1438                            'quantity' => intval($quantity),
     1439                            'price' => $price
    14231440                        ];
    14241441                    }
     
    18521869
    18531870                    $order->payment_complete($payment->id);
    1854                     update_post_meta($order->get_id(), '_transaction_url', $payment->merchantPortalOrderUrl);
     1871                    $order->update_meta_data('_transaction_url', $payment->merchantPortalOrderUrl);
     1872                    $order->save();
    18551873                } else {
    18561874                    $order->update_status('failed', sprintf(__('Payment declined. Afterpay Order ID: %s.', 'woo_afterpay'), $payment->id));
     
    19191937                    $product = wc_get_product($item['product_id']);
    19201938                }
     1939                $name = $product->get_name();
     1940                $quantity = $item['quantity'];
     1941                $price = number_format(wc_get_price_excluding_tax($product), 2, '.', '');
     1942                if ((fmod($quantity, 1) !== 0.00)) {
     1943                    $name = $name . ' (' . $quantity . ')';
     1944                    $price = number_format((float) wc_get_price_excluding_tax($product) * $quantity, 2, '.', '');
     1945                    $quantity = 1;
     1946                }
    19211947                $latest_cart['items'][] = array(
    1922                     'name' => $product->get_name(),
     1948                    'name' => $name,
    19231949                    'sku' => $product->get_sku(),
    1924                     'quantity' => $item['quantity'],
     1950                    'quantity' => intval($quantity),
    19251951                    'price' => array(
    1926                         'amount' => number_format(wc_get_price_excluding_tax($product), 2, '.', ''),
     1952                        'amount' => $price,
    19271953                        'currency' => $currency
    19281954                    )
  • afterpay-gateway-for-woocommerce/tags/3.5.4/readme.txt

    r2852674 r2929579  
    33Tags: woocommerce, afterpay
    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/
     
    3939
    4040== Changelog ==
     41
     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.
    4148
    4249= 3.5.3 =
  • afterpay-gateway-for-woocommerce/trunk/afterpay-gateway-for-woocommerce.php

    r2852674 r2929579  
    55 * Author: Afterpay
    66 * Author URI: https://www.afterpay.com/
    7  * Version: 3.5.3
     7 * Version: 3.5.4
    88 * Text Domain: afterpay-gateway-for-woocommerce
    99 * WC requires at least: 3.2.6
    10  * WC tested up to: 7.3.0
     10 * WC tested up to: 7.8.0
    1111 *
    1212 * Copyright: (c) 2020 Afterpay
     
    4646         *                                          the value in the comments above.
    4747         */
    48         public static $version = '3.5.3';
     48        public static $version = '3.5.4';
    4949
    5050        /**
     
    416416    add_action( 'plugins_loaded', array('Afterpay_Plugin', 'init'), 10, 0 );
    417417    add_action( 'woocommerce_blocks_loaded', array('Afterpay_Plugin', 'add_woocommerce_blocks_support') );
     418    // Declare compatibility with custom order tables for WooCommerce.
     419    add_action( 'before_woocommerce_init', function() {
     420            if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
     421                \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
     422            }
     423        }
     424    );
    418425}
  • afterpay-gateway-for-woocommerce/trunk/build/afterpay-blocks.asset.php

    r2852674 r2929579  
    1 <?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'd38778937a5ede934c4a96ec222e2652');
     1<?php return array('dependencies' => array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '369fa1347fe714af4a8940ee39041733');
  • afterpay-gateway-for-woocommerce/trunk/build/afterpay-page-checkout.asset.php

    r2852674 r2929579  
    1 <?php return array('dependencies' => array(), 'version' => 'ed96315bede061adca0042e12ec7f2f9');
     1<?php return array('dependencies' => array(), 'version' => 'f3029f05748f1d0fbba70e15363fe049');
  • afterpay-gateway-for-woocommerce/trunk/class/WC_Gateway_Afterpay.php

    r2852674 r2929579  
    10801080                        foreach ($items as $item) {
    10811081                            if ($product = $item->get_product()) {
     1082                                $name = $product->get_name();
     1083                                $quantity = $item->get_quantity();
     1084                                $price = [ (float) $item->get_subtotal() / $quantity, $currency ];
     1085                                if ((fmod($quantity, 1) !== 0.00)) {
     1086                                    $name = $name . ' (' . $quantity . ')';
     1087                                    $price = [ (float) $item->get_subtotal(), $currency ];
     1088                                    $quantity = 1;
     1089                                }
    10821090                                $itemsData[] = [
    1083                                     'name' => $product->get_name(),
     1091                                    'name' => $name,
    10841092                                    'sku' => $product->get_sku(),
    1085                                     'quantity' => $item->get_quantity(),
    1086                                     'price' => [ (float) $item->get_subtotal() / $item->get_quantity(), $currency ]
     1093                                    'quantity' => intval($quantity),
     1094                                    'price' => $price
    10871095                                ];
    10881096                            }
     
    11751183
    11761184                        $order->payment_complete($payment->id);
    1177                         update_post_meta($order_id, '_transaction_url', $payment->merchantPortalOrderUrl);
     1185                        $order->update_meta_data('_transaction_url', $payment->merchantPortalOrderUrl);
     1186                        $order->save();
    11781187                        if (wp_redirect( $this->get_return_url($order) )) {
    11791188                            exit;
     
    12071216         */
    12081217        public function get_transaction_url($order) {
    1209             $url = get_post_meta($order->get_id(), '_transaction_url', true);
     1218            $url = $order->get_meta('_transaction_url');
    12101219            if (empty($url)) {
    12111220                try {
     
    14161425                            $product = wc_get_product($item['product_id']);
    14171426                        }
     1427                        $name = $product->get_name();
     1428                        $quantity = $item['quantity'];
     1429                        $price = [ wc_get_price_excluding_tax($product), $currency ];
     1430                        if ((fmod($quantity, 1) !== 0.00)) {
     1431                            $name = $name . ' (' . $quantity . ')';
     1432                            $price = [ number_format((float) wc_get_price_excluding_tax($product) * $quantity, 2, '.', ''), $currency ];
     1433                            $quantity = 1;
     1434                        }
    14181435                        $itemsData[] = [
    1419                             'name' => $product->get_name(),
     1436                            'name' => $name,
    14201437                            'sku' => $product->get_sku(),
    1421                             'quantity' => $item['quantity'],
    1422                             'price' => [ wc_get_price_excluding_tax($product), $currency ]
     1438                            'quantity' => intval($quantity),
     1439                            'price' => $price
    14231440                        ];
    14241441                    }
     
    18521869
    18531870                    $order->payment_complete($payment->id);
    1854                     update_post_meta($order->get_id(), '_transaction_url', $payment->merchantPortalOrderUrl);
     1871                    $order->update_meta_data('_transaction_url', $payment->merchantPortalOrderUrl);
     1872                    $order->save();
    18551873                } else {
    18561874                    $order->update_status('failed', sprintf(__('Payment declined. Afterpay Order ID: %s.', 'woo_afterpay'), $payment->id));
     
    19191937                    $product = wc_get_product($item['product_id']);
    19201938                }
     1939                $name = $product->get_name();
     1940                $quantity = $item['quantity'];
     1941                $price = number_format(wc_get_price_excluding_tax($product), 2, '.', '');
     1942                if ((fmod($quantity, 1) !== 0.00)) {
     1943                    $name = $name . ' (' . $quantity . ')';
     1944                    $price = number_format((float) wc_get_price_excluding_tax($product) * $quantity, 2, '.', '');
     1945                    $quantity = 1;
     1946                }
    19211947                $latest_cart['items'][] = array(
    1922                     'name' => $product->get_name(),
     1948                    'name' => $name,
    19231949                    'sku' => $product->get_sku(),
    1924                     'quantity' => $item['quantity'],
     1950                    'quantity' => intval($quantity),
    19251951                    'price' => array(
    1926                         'amount' => number_format(wc_get_price_excluding_tax($product), 2, '.', ''),
     1952                        'amount' => $price,
    19271953                        'currency' => $currency
    19281954                    )
  • afterpay-gateway-for-woocommerce/trunk/readme.txt

    r2852674 r2929579  
    33Tags: woocommerce, afterpay
    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/
     
    3939
    4040== Changelog ==
     41
     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.
    4148
    4249= 3.5.3 =
Note: See TracChangeset for help on using the changeset viewer.