Plugin Directory

Changeset 2428892


Ignore:
Timestamp:
11/30/2020 07:48:31 PM (5 years ago)
Author:
sixg
Message:

Created tag v2.4.12.

Location:
splitit-installment-payments-enabler/tags/v2.4.12
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • splitit-installment-payments-enabler/tags/v2.4.12/classes/splitit-api.php

    r2414010 r2428892  
    5353        $params = array('UserName' => $this->_username,
    5454            'Password' => $this->_password,
    55             'TouchPoint' => array("Code" => "WooCommercePlugin", "Version" => "2.4.11"),
     55            'TouchPoint' => array("Code" => "WooCommercePlugin", "Version" => "2.4.12"),
    5656        );
    5757
     
    232232                "Email" => $order_data['Email'],
    233233                "PhoneNumber" => $order_data['Phone'],
     234                "CultureName" => $culture = str_replace('_', '-', get_locale()),
    234235            );
    235236            $params['PaymentWizardData'] = array(
     
    250251            }
    251252
    252             $items = WC()->cart->get_cart();
     253            $cart = WC()->cart;
     254            $items = $cart->get_cart();
     255            if (!function_exists('is_plugin_active')) {
     256                include_once(ABSPATH . 'wp-admin/includes/plugin.php');
     257            }
     258            if (is_plugin_active('woocommerce-avatax/woocommerce-avatax.php')) {     // if avatax enabled, recalculate taxes
     259                define(WOOCOMMERCE_CHECKOUT, true);
     260                $this->removeTaxCache();
     261                new WC_Cart_Totals($cart);
     262                WC()->cart->calculate_totals();
     263            }
    253264            $itemsArr = array();
    254265            foreach ($items as $item => $values) {
     
    261272                ));
    262273            }
     274            $params['PlanData']['Amount']['Value']=WC()->cart->get_total(false);
    263275            $params['CartData'] = array(
    264276                "Items" => $itemsArr,
     
    350362            try {
    351363                // print_r($params);
     364                $this->_log->info(__FILE__, __LINE__, __METHOD__);
     365                $this->_log->add($params);
    352366                $result = $this->make_request($this->_API['url'], "InstallmentPlan/Initiate", $params);
    353367                $userid = "0";
     
    645659    }
    646660
     661    /**
     662     * Remove tax cache to allow recalculate tax when avatax is installed
     663     */
     664    public function removeTaxCache()
     665    {
     666        global $wp_object_cache;
     667        $cache = $wp_object_cache->cache;
     668        unset($cache['taxes']);
     669        $wp_object_cache->cache = $cache;
     670    }
    647671}
  • splitit-installment-payments-enabler/tags/v2.4.12/classes/splitit-settings.php

    r2395597 r2428892  
    4141        $fields =
    4242        array(
    43             'enabled' => array(
    44                 'title' => __('Enable/Disable', 'splitit'),
    45                 'type' => 'checkbox',
    46                 'label' => __('Enable Splitit Payment', 'splitit'),
    47                 'default' => 'yes',
    48             ),
    4943            '_General_settings' => array(
    5044                'type' => 'title',
     
    5246                'description' => __('Api and debug settings'),
    5347            ),
     48
     49            'enabled' => array(
     50                'title' => __('Enable/Disable', 'splitit'),
     51                'type' => 'checkbox',
     52                'label' => __('Enable Splitit Payment', 'splitit'),
     53                'default' => 'yes',
     54            ),
    5455
    5556            'splitit_api_terminal_key' => array(
  • splitit-installment-payments-enabler/tags/v2.4.12/readme.txt

    r2414010 r2428892  
    33Tags: ecommerce, e-commerce, commerce, wordpress ecommerce, sales, sell, shop, shopping, checkout, payment, splitit
    44Requires at least: 3.0.1
    5 Tested up to: 5.5.0
    6 Stable tag: 2.4.11
     5Tested up to: 5.6.0
     6Stable tag: 2.4.12
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    7171== Changelog ==
    7272
     73= 2.4.12 =
     74* Fix tax when avatax is installed
     75* Add support language on checkout
     76* Fix BR culture
     77* Fix session issue
     78* Fix settings save
     79* Fix for google crawlers
     80
    7381= 2.4.11 =
    7482*Fix help me link
  • splitit-installment-payments-enabler/tags/v2.4.12/splitit.php

    r2414010 r2428892  
    55Plugin URI: http://wordpress.org/plugins/splitit/
    66Description: Integrates Splitit payment method into your WooCommerce installation.
    7 Version: 2.4.11
     7Version: 2.4.12
    88Author: Splitit
    99Text Domain: splitit
     
    177177    if (!class_exists('WC_Payment_Gateway')) {return;}
    178178
    179     define('Splitit_VERSION', '2.4.11');
     179    define('Splitit_VERSION', '2.4.12');
    180180    define('Splitit_logo_source_local', plugin_dir_url(__FILE__) . 'assets/images/Offical_Splitit_Logo.png');
    181181
     
    434434            do_action('splitit_settings_table_before');
    435435
    436             echo "<table class=\"form-table\">";
     436//          echo "<table class=\"form-table\">";
    437437            $this->generate_settings_html();
    438             echo "</table";
     438//          echo "</table";
    439439
    440440            do_action('splitit_settings_table_after');
     
    12601260            // $esi = isset($_COOKIE["splitit_checkout_session_id_data"]) ? wc_clean($_COOKIE["splitit_checkout_session_id_data"]) : false;
    12611261            $esi = (WC()->session->get('splitit_checkout_session_id_data')) ? WC()->session->get('splitit_checkout_session_id_data') : false;
     1262            if(!$esi){
     1263                $api = self::getApi($this->settings);
     1264                $esi = $api->login();
     1265            }
    12621266            // echo $esi.'<pre>';
    12631267            // print_r(WC()->session->get('splitit_checkout_session_id_data'));die('-------fsfsdfs');
     
    12661270            if (empty($exists_data_array)) {
    12671271                $api = self::getApi($this->settings); //passing settings to API
     1272               
     1273                /* Fix for avatax */
     1274                $cart = WC()->cart;
     1275                if (!function_exists('is_plugin_active')) {
     1276                    include_once(ABSPATH . 'wp-admin/includes/plugin.php');
     1277                }
     1278                if (is_plugin_active('woocommerce-avatax/woocommerce-avatax.php')) {     // if avatax enabled, recalculate taxes
     1279                    define(WOOCOMMERCE_CHECKOUT, true);
     1280                    $api->removeTaxCache();
     1281                    new WC_Cart_Totals($cart);
     1282                    WC()->cart->calculate_totals();
     1283                }
     1284                /* Fix for avatax */
     1285               
    12681286                if (!isset($this->settings['splitit_cancel_url']) || $this->settings['splitit_cancel_url'] == '') {
    12691287                    $this->settings['splitit_cancel_url'] = 'checkout/';
     
    12821300                    exit;
    12831301                }
    1284                 $total_amount_on_cart = WC()->cart->total;
     1302                $total_amount_on_cart = WC()->cart->get_total(false);
    12851303                if($total_amount_on_cart != $verifyData->{'OriginalAmountPaid'}){
    12861304                    wc_clear_notices();
     
    16481666            $learnmore = " <a href='" . $this->getHelpMeLink($product->get_price()) . "' id='tell-me-more'>" . $learnmoreImage . "</a>";
    16491667            $split_price = round($product->get_price() / self::$_maxInstallments, 3);
    1650             return '<span style="display:block;" class="splitit-installment-price splitit-installment-price-product">or ' . self::$_maxInstallments . ' interest-free payments of ' . wc_price($split_price, array('decimals' => 2)) . ' with ' . $replace . $learnmore . '</span>';
     1668            $resultPrice = str_replace('woocommerce-Price-amount', '', wc_price($split_price, array('decimals' => 2)));
     1669            return '<span style="display:block;" class="splitit-installment-price splitit-installment-price-product">or ' . self::$_maxInstallments . ' interest-free payments of ' . $resultPrice . ' with ' . $replace . $learnmore . '</span>';
    16511670        }
    16521671
     
    20012020            $apiKey = $this->get_option('splitit_api_terminal_key');
    20022021            $culture = str_replace('_', '-', get_locale());
     2022            $culture = $culture != 'pt-BR' ?: 'pt-PT';
    20032023            $currencyCode = "USD";
    20042024            if (get_woocommerce_currency() != "") {
Note: See TracChangeset for help on using the changeset viewer.