Changeset 2428892
- Timestamp:
- 11/30/2020 07:48:31 PM (5 years ago)
- Location:
- splitit-installment-payments-enabler/tags/v2.4.12
- Files:
-
- 4 edited
- 1 copied
-
. (copied) (copied from splitit-installment-payments-enabler/trunk)
-
classes/splitit-api.php (modified) (6 diffs)
-
classes/splitit-settings.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
splitit.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
splitit-installment-payments-enabler/tags/v2.4.12/classes/splitit-api.php
r2414010 r2428892 53 53 $params = array('UserName' => $this->_username, 54 54 'Password' => $this->_password, 55 'TouchPoint' => array("Code" => "WooCommercePlugin", "Version" => "2.4.1 1"),55 'TouchPoint' => array("Code" => "WooCommercePlugin", "Version" => "2.4.12"), 56 56 ); 57 57 … … 232 232 "Email" => $order_data['Email'], 233 233 "PhoneNumber" => $order_data['Phone'], 234 "CultureName" => $culture = str_replace('_', '-', get_locale()), 234 235 ); 235 236 $params['PaymentWizardData'] = array( … … 250 251 } 251 252 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 } 253 264 $itemsArr = array(); 254 265 foreach ($items as $item => $values) { … … 261 272 )); 262 273 } 274 $params['PlanData']['Amount']['Value']=WC()->cart->get_total(false); 263 275 $params['CartData'] = array( 264 276 "Items" => $itemsArr, … … 350 362 try { 351 363 // print_r($params); 364 $this->_log->info(__FILE__, __LINE__, __METHOD__); 365 $this->_log->add($params); 352 366 $result = $this->make_request($this->_API['url'], "InstallmentPlan/Initiate", $params); 353 367 $userid = "0"; … … 645 659 } 646 660 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 } 647 671 } -
splitit-installment-payments-enabler/tags/v2.4.12/classes/splitit-settings.php
r2395597 r2428892 41 41 $fields = 42 42 array( 43 'enabled' => array(44 'title' => __('Enable/Disable', 'splitit'),45 'type' => 'checkbox',46 'label' => __('Enable Splitit Payment', 'splitit'),47 'default' => 'yes',48 ),49 43 '_General_settings' => array( 50 44 'type' => 'title', … … 52 46 'description' => __('Api and debug settings'), 53 47 ), 48 49 'enabled' => array( 50 'title' => __('Enable/Disable', 'splitit'), 51 'type' => 'checkbox', 52 'label' => __('Enable Splitit Payment', 'splitit'), 53 'default' => 'yes', 54 ), 54 55 55 56 'splitit_api_terminal_key' => array( -
splitit-installment-payments-enabler/tags/v2.4.12/readme.txt
r2414010 r2428892 3 3 Tags: ecommerce, e-commerce, commerce, wordpress ecommerce, sales, sell, shop, shopping, checkout, payment, splitit 4 4 Requires at least: 3.0.1 5 Tested up to: 5. 5.06 Stable tag: 2.4.1 15 Tested up to: 5.6.0 6 Stable tag: 2.4.12 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 71 71 == Changelog == 72 72 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 73 81 = 2.4.11 = 74 82 *Fix help me link -
splitit-installment-payments-enabler/tags/v2.4.12/splitit.php
r2414010 r2428892 5 5 Plugin URI: http://wordpress.org/plugins/splitit/ 6 6 Description: Integrates Splitit payment method into your WooCommerce installation. 7 Version: 2.4.1 17 Version: 2.4.12 8 8 Author: Splitit 9 9 Text Domain: splitit … … 177 177 if (!class_exists('WC_Payment_Gateway')) {return;} 178 178 179 define('Splitit_VERSION', '2.4.1 1');179 define('Splitit_VERSION', '2.4.12'); 180 180 define('Splitit_logo_source_local', plugin_dir_url(__FILE__) . 'assets/images/Offical_Splitit_Logo.png'); 181 181 … … 434 434 do_action('splitit_settings_table_before'); 435 435 436 echo "<table class=\"form-table\">";436 // echo "<table class=\"form-table\">"; 437 437 $this->generate_settings_html(); 438 echo "</table";438 // echo "</table"; 439 439 440 440 do_action('splitit_settings_table_after'); … … 1260 1260 // $esi = isset($_COOKIE["splitit_checkout_session_id_data"]) ? wc_clean($_COOKIE["splitit_checkout_session_id_data"]) : false; 1261 1261 $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 } 1262 1266 // echo $esi.'<pre>'; 1263 1267 // print_r(WC()->session->get('splitit_checkout_session_id_data'));die('-------fsfsdfs'); … … 1266 1270 if (empty($exists_data_array)) { 1267 1271 $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 1268 1286 if (!isset($this->settings['splitit_cancel_url']) || $this->settings['splitit_cancel_url'] == '') { 1269 1287 $this->settings['splitit_cancel_url'] = 'checkout/'; … … 1282 1300 exit; 1283 1301 } 1284 $total_amount_on_cart = WC()->cart-> total;1302 $total_amount_on_cart = WC()->cart->get_total(false); 1285 1303 if($total_amount_on_cart != $verifyData->{'OriginalAmountPaid'}){ 1286 1304 wc_clear_notices(); … … 1648 1666 $learnmore = " <a href='" . $this->getHelpMeLink($product->get_price()) . "' id='tell-me-more'>" . $learnmoreImage . "</a>"; 1649 1667 $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>'; 1651 1670 } 1652 1671 … … 2001 2020 $apiKey = $this->get_option('splitit_api_terminal_key'); 2002 2021 $culture = str_replace('_', '-', get_locale()); 2022 $culture = $culture != 'pt-BR' ?: 'pt-PT'; 2003 2023 $currencyCode = "USD"; 2004 2024 if (get_woocommerce_currency() != "") {
Note: See TracChangeset
for help on using the changeset viewer.