Plugin Directory

Changeset 2349123


Ignore:
Timestamp:
07/30/2020 01:44:03 PM (6 years ago)
Author:
Easify
Message:

Version 4.22

Location:
easify-server-woocommerce/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • easify-server-woocommerce/trunk/easify.php

    r2317370 r2349123  
    55 * Plugin URI: http://www.easify.co.uk/wordpress/
    66 * Description: Connects Easify Business Management, EPOS (Electronic Point of Sale) and invoicing software to your WooCommerce enabled WordPress website. Allowing you to keep your online and offline shop's orders and stock control synchronised.
    7  * Version: 4.21
     7 * Version: 4.22
    88 * License: GPL2
    99 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1212 * Requires at least: 4.0
    1313 * Tested up to: 5.4
    14  * WC tested up to: 4.1
     14 * WC tested up to: 4.3
    1515 */
    1616
  • easify-server-woocommerce/trunk/includes/class-easify-wc-easify-options.php

    r2289263 r2349123  
    2323 *
    2424 * @class       Easify_WC_Easify_Options
    25  * @version     4.19
     25 * @version     4.22
    2626 * @package     easify-woocommerce-connector
    2727 * @author      Easify
     
    338338     * @return boolean Returns true if the payment method is enabled.
    339339     */
    340     public function is_payment_method_enabled($payment_method) {
     340    public function is_payment_method_enabled($payment_method) {       
    341341        if (!isset($this->payment_options['easify_payment_mapping'][$payment_method]['raise'])) {
     342            Easify_Logging::Log('Easify_WC_Easify_Options::is_payment_method_enabled() payment mapping not set for: ' . $payment_method);           
    342343            return false;
    343344        }
    344345
    345346        if ($this->payment_options['easify_payment_mapping'][$payment_method]['raise'] == 'true') {
     347            Easify_Logging::Log('Easify_WC_Easify_Options::is_payment_method_enabled() payment method enabled: ' . $payment_method);               
    346348            return true;
    347349        }
    348350
     351            Easify_Logging::Log('Easify_WC_Easify_Options::is_payment_method_enabled() payment method not enabled: ' . $payment_method);                       
    349352        return false;
    350353    }
     
    359362     */
    360363    public function get_payment_mapping_by_payment_method_name($payment_method_name) {
     364        Easify_Logging::Log('Easify_WC_Easify_Options::get_payment_mapping_by_payment_method_name() ' . $payment_method_name); 
     365                   
    361366        if (isset($this->payment_options['easify_payment_mapping'][$payment_method_name])) {
     367            Easify_Logging::Log('Easify_WC_Easify_Options::get_payment_mapping_by_payment_method_name() ' . $payment_method_name . ' mapping set'); 
    362368            return $this->payment_options['easify_payment_mapping'][$payment_method_name];
    363369        }
    364370
     371        Easify_Logging::Log('Easify_WC_Easify_Options::get_payment_mapping_by_payment_method_name() ' . $payment_method_name . ' mapping not set');         
    365372        return NULL;
    366373    }
     
    374381    public function get_payment_comment_by_payment_method_name($payment_method_name) {
    375382        if (!isset($this->payment_options['easify_payment_comment'])) {
    376             return '';
    377         }
    378 
    379         return $this->payment_options['easify_payment_comment'];
     383            return 'Paid via ' . $payment_method_name;
     384        }
     385
     386        return $this->payment_options['easify_payment_comment'] . ' (' . $payment_method_name . ')';
    380387    }
    381388
  • easify-server-woocommerce/trunk/includes/class-easify-wc-plugin-settings-page.php

    r2289263 r2349123  
    3030 *
    3131 * @class       Easify_WC__Plugin_Settings_Page
    32  * @version     4.19
     32 * @version     4.22
    3333 * @package     easify-woocommerce-connector
    3434 * @author      Easify
     
    19251925                <p>When an order is placed via WooCommerce, it will be sent to your Easify Server and a payment record will be created
    19261926                    in Easify.</p>
    1927                 <p>Here you can enter the comment that will be added to the payment record in Easify.</p>               
     1927                <p>Here you can enter the comment that will be added to the payment record in Easify.</p>   
     1928                <p>The payment method used by the customer will be appended to this value so if the customer pays using stripe
     1929                the comment on the payment record in Easify will be 'Payment via website (stripe)'.</p>
    19281930                <?= $this->tooltip_click_here_link('payments-comment') ?>             
    19291931            </div>                       
  • easify-server-woocommerce/trunk/includes/class-easify-wc-send-order-to-easify.php

    r2315763 r2349123  
    3131 *
    3232 * @class       Easify_WC_Send_Order_To_Easify
    33  * @version     4.20
     33 * @version     4.22
    3434 * @package     easify-woocommerce-connector
    3535 * @author      Easify
     
    377377
    378378    private function do_payment() {
    379         // If this payment method has not been enabled in Easify Options, do nothing   
    380         if (!$this->easify_options->is_payment_method_enabled($this->woocommerce_order->payment_method)) {
    381             return;
    382         }
    383 
     379        Easify_Logging::Log('Easify_WC_Send_Order_To_Easify.do_payment() Payment Method: ' . $this->woocommerce_order->payment_method);
     380           
    384381        // Get the payment mapping details from the Easify options...
    385382        $payment_mapping = $this->easify_options->get_payment_mapping_by_payment_method_name($this->woocommerce_order->payment_method);
    386 
     383       
    387384        if ($payment_mapping == NULL) {
    388385            // Use default payment mapping if no matching mapping found - i.e.
    389386            // if WooCommerce has a payment method that we don't support.
    390             $payment_mapping = $this->easify_options->get_payment_mapping_by_payment_method_name('Default');
     387            Easify_Logging::Log('Easify_WC_Send_Order_To_Easify.do_payment() - unknown payment method, using default.');               
     388               
     389            $payment_mapping = $this->easify_options->get_payment_mapping_by_payment_method_name('default');
     390                       
     391            // If this payment method has not been enabled in Easify Options, do nothing   
     392            if (!$this->easify_options->is_payment_method_enabled('default')) {
     393                Easify_Logging::Log('Easify_WC_Send_Order_To_Easify.do_payment() - default payment method not enabled, ignoring.');               
     394                return;
     395            }         
     396        }
     397        else {
     398            // We have a payment mapping use it and make sure it is enabled...
     399            // If this payment method has not been enabled in Easify Options, do nothing   
     400            if (!$this->easify_options->is_payment_method_enabled($this->woocommerce_order->payment_method)) {
     401                Easify_Logging::Log('Easify_WC_Send_Order_To_Easify.do_payment() - payment method not enabled, ignoring.');
     402                return;
     403            }           
    391404        }
    392405
  • easify-server-woocommerce/trunk/readme.txt

    r2317370 r2349123  
    55Requires at least: 4.0
    66Tested up to: 5.4
    7 Stable tag: 4.21
     7Stable tag: 4.22
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    10 WC tested up to: 4.1
     10WC tested up to: 4.3
    1111
    1212Connects Easify V4.x Small Business Software to your WooCommerce online shop,
     
    101101
    102102== Changelog ==
     103= 4.22 =
     104* Fixed issue with default payment method not being sent to Easify when an order
     105is placed with a non standard payment method.
    103106= 4.21 =
    104107* Fixed issue with backorders not being allowed when stock level reaches zero.
     
    169172
    170173== Upgrade Notice ==
    171 = 4.21 =
    172 * Fixed issue with backorders not being allowed when stock level reaches zero.
     174= 4.22 =
     175* Fixed issue with default payment method not being sent to Easify when an order
     176is placed with a non standard payment method.
Note: See TracChangeset for help on using the changeset viewer.