Plugin Directory

Changeset 2395597


Ignore:
Timestamp:
10/07/2020 08:50:32 PM (5 years ago)
Author:
sixg
Message:

version upgrade to 2.4.9

Location:
splitit-installment-payments-enabler
Files:
134 added
15 edited

Legend:

Unmodified
Added
Removed
  • splitit-installment-payments-enabler/trunk/assets/css/splitit-admin-order.css

    r2316842 r2395597  
    1313span.payment-title-checkout { font-size: 13px; }
    1414span.payment-title-checkout #tell-me-more{ float:none !important; color:#6d6d6d;  box-shadow:none !important;display: inline-block;vertical-align: middle;}
     15span.tell-me-more-image-wrapper { display:inline-block; width:12px; }
  • splitit-installment-payments-enabler/trunk/assets/css/splitit-front.css

    r2316842 r2395597  
    3434span.splitit-installment-price-product #tell-me-more{ float: none; text-decoration: none !important; box-shadow:none !important;}
    3535.tell-me-more-image { float: none !important; vertical-align: middle; }
    36 .splitit-installment-price-checkout .tell-me-more-image{ width: 12px; }
     36.splitit-installment-price-checkout .tell-me-more-image{ width: 12px !important; }
    3737.splitit-installment-price-product .tell-me-more-image {width: 12px;margin-bottom:5px;}
    3838span.splitit-installment-price-checkout {    font-size: 15px !important;}
     
    4444.related .splitit-installment-price-product, .related #tell-me-more {display: none !important;}
    4545
    46 div.payment_box.payment_method_splitit img.tell-me-more-image {max-height: 100% !important;}
     46span.tell-me-more-image-wrapper { display:inline-block; width:12px; }
  • splitit-installment-payments-enabler/trunk/assets/javascript/splitit-checkout.js

    r2353339 r2395597  
    5252        var top = (screen.height/2)-(window.innerHeight/2);
    5353        var win= window.open(this.href,"Tell me more","width=433,height=607,left="+left+",top="+top+",location=no,status=no,scrollbars=no,resizable=no");
    54         win.document.writeln("<body style='margin:0px'><img width=100% src='"+this.href+"' />");
    55         win.document.writeln("</body>");
    56         win.document.write('<title>Splitit Learn More</title>');
    57        
     54
    5855        return;
    5956        $.ajax({
     
    186183     */
    187184    function getFormFields() {
    188         var field_blocks = $('form.woocommerce-checkout .validate-required,#ship-to-different-address,#terms');
     185        var field_blocks = $('form.woocommerce-checkout .validate-required,#ship-to-different-address,#terms,#billing_city_field');
    189186        var fields = {};
    190187        field_blocks.each(function() {
     
    243240            } else {
    244241                var elem = $(this).find('input.input-text').val();
     242            }
     243
     244            if ($(this).prop('id') == 'billing_city_field' && !elem) {
     245                elem = $('#billing_country option:selected').text();
    245246            }
    246247
  • splitit-installment-payments-enabler/trunk/classes/splitit-api.php

    r2353339 r2395597  
    5353        $params = array('UserName' => $this->_username,
    5454            'Password' => $this->_password,
    55             'TouchPoint' => array("Code" => "WooCommercePlugin", "Version" => "2.4.6"),
     55            'TouchPoint' => array("Code" => "WooCommercePlugin", "Version" => "2.4.9"),
    5656        );
    5757
     
    197197                        $percentageOfOrder = 50;
    198198                    }
    199                     $firstInstallmentAmount = (($order_data['AmountBeforeFees'] * $percentageOfOrder) / 100);
     199                    $firstInstallmentAmount = round((($order_data['AmountBeforeFees'] * $percentageOfOrder) / 100), 2);
    200200                    // var_dump($firstInstallmentAmount);
    201201                }
     
    362362                    $user_data = "";
    363363                    if (isset($_COOKIE['splitit_checkout'])) {
    364                         $user_data = wc_clean($_COOKIE['splitit_checkout']);
     364                        $user_data = urldecode(wc_clean($_COOKIE['splitit_checkout']));
    365365                    }
    366366
  • splitit-installment-payments-enabler/trunk/classes/splitit-helper.php

    r2316842 r2395597  
    2929        if (isset($_GET['page']) && $_GET['page'] == 'wc-settings' && isset($_GET['tab']) && $_GET['tab'] == 'checkout') {
    3030            wp_enqueue_style('splitit_prodlist_admin_css', plugins_url('/assets/css/splitit-admin.css', dirname(__FILE__)));
     31        }
     32        /* support multi currency plugin */
     33        if (isset($_GET['page']) && $_GET['page'] == 'woocommerce-multi-currency') {
     34            wp_enqueue_style('splitit_order_admin_css', plugins_url('/assets/css/splitit-admin-order.css', dirname(__FILE__)));
    3135        }
    3236    }
  • splitit-installment-payments-enabler/trunk/classes/splitit-settings.php

    r2353339 r2395597  
    467467                    'custom_attributes' => array('readonly' => 'readonly'),
    468468            */
    469             'splitit_help_title_link_local' => array(
    470                 'type' => 'text',
    471                 'class' => 'hidden',
    472                 'default' => Splitit_learnmore_imgsource_local
    473             ),
    474469            '_3dSecure ' => array(
    475470                'type' => 'title',
  • splitit-installment-payments-enabler/trunk/readme.txt

    r2359161 r2395597  
    44Requires at least: 3.0.1
    55Tested up to: 5.5.0
    6 Stable tag: 2.4.6
     6Stable tag: 2.4.9
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1212== Description ==
    1313
    14 Splitit – Interest-Free Monthly Payments plugin for WooCommerce<br>
     14Splitit – Interest-Free Monthly Payments plugin for WooCommerce<br/>
     15<br/>
     16<a href="https://www.splitit.com/">Splitit</a> is a payment method solution enabling customers to pay for purchases with an existing debit or credit card by splitting the cost into interest and fee free monthly payments, without additional registrations or applications.<br/>
     17Splitit enables merchants to offer their customers an easy way to pay for purchases in monthly instalments with instant approval, decreasing cart abandonment rates and increasing revenue.<br/>
     18Serving many of Internet Retailer’s top 500 merchants, Splitit’s global footprint extends to hundreds of merchants in countries around the world. Headquartered in New York, Splitit has an R&D center in Israel and offices in London and Australia.<br/>
     19<br/>
    1520Start offering your customers **interest-free installment payments** on their existing credit cards today!<br>
    1621The Splitit  WooCommerce plugin lets your customers pay for your goods and services via interest-free monthly installments on the Visa and Master Card credit cards they already have in their wallets.
     
    2126Interest-free installment payments make great business sense!<br><br>
    2227Ecommerce merchants that offer Splitit to their customers enjoy:<br>
    23 -Increased sales
    24 <br>
     28-Increased sales<br>
    2529-Higher average tickets<br>
    26 
    27 -Increased conversion rates
    28 <br>
     30-Increased conversion rates<br>
    2931-A better alternative to discounts and promotions<br>
    3032-Stronger brand value<br>
     
    6971== Changelog ==
    7072
     73= 2.4.9 =
     74*Fix Splitit payment method title for checkout, admin and invoice - remove html from admin and invoice
     75
     76= 2.4.8 =
     77*Fix optional city field issue
     78
     79= 2.4.7 =
     80*Fix big question mark
     81*Fix plus sign
     82*Include installment price text
     83*Paypal compatibility
     84*Round firstpayment amount for percentage type
     85*Change to the new learn more
     86*Wordperss 5.5 compatibility
     87
    7188= 2.4.6 =
    7289*Remove zipcode validation on special countries
  • splitit-installment-payments-enabler/trunk/splitit.php

    r2353339 r2395597  
    55Plugin URI: http://wordpress.org/plugins/splitit/
    66Description: Integrates Splitit payment method into your WooCommerce installation.
    7 Version: 2.4.6
     7Version: 2.4.9
    88Author: Splitit
    99Text Domain: splitit
     
    177177    if (!class_exists('WC_Payment_Gateway')) {return;}
    178178
    179     define('Splitit_VERSION', '2.4.6');
     179    define('Splitit_VERSION', '2.4.9');
    180180    define('Splitit_logo_source_local', plugin_dir_url(__FILE__) . 'assets/images/Offical_Splitit_Logo.png');
    181     define('Splitit_learnmore_imgsource_local', plugin_dir_url(__FILE__) . 'assets/images/V1-USD.png');
    182181
    183182    // Import helper classes
     
    244243
    245244            //echo $this->settings['splitit_help_title_link_local'];die;
    246             $learnmoreImage = '<img class="tell-me-more-image" src="' . plugin_dir_url(__FILE__) . 'assets/images/learn_more.png" >';
    247             $textToDisplay = "<span class='payment-title-checkout'><img  class='paymentlogoWidthSrc' src='" . $this->s('splitit_logo_src_local') . "' alt='SPLITIT'/> ".__("0% INTEREST MONTHLY PAYMENTS")." <a href='" . $this->s('splitit_help_title_link_local') . "' id='tell-me-more'>" . $learnmoreImage . "</a></span>";
     245            $learnmoreImage = '<span class="tell-me-more-image-wrapper"><img class="tell-me-more-image" src="' . plugin_dir_url(__FILE__) . 'assets/images/learn_more.png" ></span>';
     246            // $textToDisplay = "<span class=\"payment-title-checkout\"><img  class=\"paymentlogoWidthSrc\" src=\"" . $this->s('splitit_logo_src_local') . "\" alt=\"SPLITIT\"/> ".__("0% INTEREST MONTHLY PAYMENTS")." <a href=\"" . $this->getHelpMeLink() . "\" id=\"tell-me-more\">" . $learnmoreImage . "</a></span>";
     247            $textToDisplay = "Splitit <span class=\"payment-title-checkout\">".__("0% INTEREST MONTHLY PAYMENTS")." <a href=\"" . $this->getHelpMeLink() . "\" id=\"tell-me-more\">" . $learnmoreImage . "</a></span>";
    248248            $descriptionImage = '<span class="description_image"><img class="tell-me-more-image" src="' . plugin_dir_url(__FILE__) . 'assets/images/description.png" ></span>';
    249249            //echo $textToDisplay;die;
    250             $this->title = $textToDisplay;
    251             $this->description = $descriptionImage;
     250            $this->title = "Splitit";
     251            // $this->title = $textToDisplay;
     252            $this->description = "<script>
     253                (function(i,s,o,g,r,a,m){i['SplititObject']=r;i[r]=i[r]||function(){
     254                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
     255                m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
     256                })(window, document, 'script', '//upstream.production.splitit.com/v1/dist/upstream-messaging.js?v='+(Math.ceil(new Date().getTime()/100000)), 'splitit');
     257           
     258                splitit('init', { apiKey: '{$this->s('splitit_api_terminal_key')}', lang: 'en', currency: 'USD', currencySymbol: '$', debug: false });
     259            </script>
     260            <div data-splitit='true' data-splitit-amount='100' data-splitit-num-installments='3' data-splitit-type='product-description'></div>";
     261            $this->description = "<script>
     262                jQuery('.wc_payment_method.payment_method_splitit label').html(jQuery('.wc_payment_method.payment_method_splitit label').html().replace('Splitit','$textToDisplay'));
     263            </script>".
     264            $descriptionImage;
    252265            $this->instructions = $this->s('instructions');
    253266            // if($this->s('splitit_max_installments') && $this->s('splitit_max_installments') != '' && $this->s('splitit_max_installments') <= $this->s('splitit_max_installments_limit')) {
     
    15371550                    if (is_product() && in_array('product', $sections)) {
    15381551                        if($this->isSplititTextVisibleOnProduct($product->get_id())){
    1539                             return $price . $this->get_formatted_installment_price($product);
     1552                            return $price . '</p><p class="splitprice" style="margin-top: -30px;">' .$this->get_formatted_installment_price($product);
    15401553                        } else {
    15411554                            return $price;
     
    15491562                    }
    15501563                    if (is_checkout() && in_array('checkout', $sections)) {
    1551                         return $price . $this->get_formatted_installment_price($product);
    1552                     }
     1564                        if (method_exists($product, 'get_price')) {
     1565                            return $price . $this->get_formatted_installment_price($product);
     1566                        }
     1567                        return $price;
     1568                    }
    15531569                }
    15541570            }
     
    15931609                    if (isset($this->settings['splitit_logo_src_local']) && $this->settings['splitit_logo_src_local']) {
    15941610                        //echo $this->settings['splitit_help_title_link_local'];die;
    1595                         $replace = "<a id='tell-me-more' href='" . $this->settings['splitit_help_title_link_local'] . "' class='no-lightbox' target='_blank'><img  class='logoWidthSrc' src='" . $this->settings['splitit_logo_src_local'] . "' alt='SPLITIT'/></a>";
     1611                        $replace = "<a id='tell-me-more' href='" . $this->getHelpMeLink($price) . "' class='no-lightbox' target='_blank'><img  class='logoWidthSrc' src='" . $this->settings['splitit_logo_src_local'] . "' alt='SPLITIT'/></a>";
    15961612                        /*$textToDisplay = str_replace('SPLITIT', $replace, $this->settings['splitit_without_interest']);*/
    15971613                    }
    1598                     $learnmoreImage = '<img class="tell-me-more-image" src="' . plugin_dir_url(__FILE__) . 'assets/images/learn_more.png">';
    1599                     $learnmore = " <a id='tell-me-more' href='" . $this->settings['splitit_help_title_link_local'] . "' class='no-lightbox' target='_blank'>" . $learnmoreImage . "</a>";
     1614                    $learnmoreImage = '<span class="tell-me-more-image-wrapper"><img class="tell-me-more-image" src="' . plugin_dir_url(__FILE__) . 'assets/images/learn_more.png"></span>';
     1615                    $learnmore = " <a id='tell-me-more' href='" . $this->getHelpMeLink($price) . "' class='no-lightbox' target='_blank'>" . $learnmoreImage . "</a>";
    16001616                    //$prodData = $product->get_data();
    16011617                    //$split_price = round($prodData['price'] / self::$_maxInstallments, 3);
     
    16261642            if (isset($this->settings['splitit_logo_src_local']) && $this->settings['splitit_logo_src_local']) {
    16271643                //echo $this->settings['splitit_help_title_link_local'];die;
    1628                 $replace = "<a href='" . $this->settings['splitit_help_title_link_local'] . "' id='tell-me-more'><img  class='logoWidthSrc' src='" . $this->settings['splitit_logo_src_local'] . "' alt='SPLITIT'/></a>";
     1644                $replace = "<a href='" . $this->getHelpMeLink($product->get_price()) . "' id='tell-me-more'><img  class='logoWidthSrc' src='" . $this->settings['splitit_logo_src_local'] . "' alt='SPLITIT'/></a>";
    16291645                $textToDisplay = str_replace('SPLITIT', $replace, isset($this->settings['splitit_without_interest'])?$this->settings['splitit_without_interest']:'');
    16301646            }
    1631             $learnmoreImage = '<img class="tell-me-more-image" src="' . plugin_dir_url(__FILE__) . 'assets/images/learn_more.png">';
    1632             $learnmore = " <a href='" . $this->settings['splitit_help_title_link_local'] . "' id='tell-me-more'>" . $learnmoreImage . "</a>";
     1647            $learnmoreImage = '<span class="tell-me-more-image-wrapper"><img class="tell-me-more-image" src="' . plugin_dir_url(__FILE__) . 'assets/images/learn_more.png"></span>';
     1648            $learnmore = " <a href='" . $this->getHelpMeLink($product->get_price()) . "' id='tell-me-more'>" . $learnmoreImage . "</a>";
    16331649            $split_price = round($product->get_price() / self::$_maxInstallments, 3);
    16341650            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>';
     
    19801996            wp_die();
    19811997        }
    1982     }
     1998
     1999        public function getHelpMeLink($amount = null)
     2000        {
     2001            $apiKey = $this->get_option('splitit_api_terminal_key');
     2002            $culture = get_locale();
     2003            $currencyCode = "USD";
     2004            if (get_woocommerce_currency() != "") {
     2005                $currencyCode = get_woocommerce_currency();
     2006            }
     2007            $numInstallments = self::$_maxInstallments;
     2008
     2009            if ($this->get_option('splitit_mode_sandbox')) {
     2010                $url = 'https://documents.sandbox.splitit.com/LearnMore?apiKey=' . $apiKey;
     2011            } else {
     2012                $url = 'https://documents.production.splitit.com/LearnMore?apiKey=' . $apiKey;
     2013            }
     2014            if ($amount) {
     2015                $url = $url . '&amount=' . $amount;
     2016            }
     2017            $url = $url . '&culture=' . $culture
     2018                . '&currencyCode=' . $currencyCode
     2019                . '&numInstallments=' . $numInstallments;
     2020
     2021
     2022            return $url;
     2023        }
     2024    }
    19832025
    19842026    // Make the object available for later use
Note: See TracChangeset for help on using the changeset viewer.