From a488b3d0b785b721996b70fc27c99040f982d755 Mon Sep 17 00:00:00 2001 From: henrik-ecomatic Date: Tue, 3 Sep 2019 10:58:29 +0200 Subject: [PATCH 01/11] WPM-68 [BUGFIX] Fixed cherry-pick conflicts --- .../class-billmate-account.php | 71 +++++++++++++++++-- .../class-billmate-common.php | 7 +- 2 files changed, 69 insertions(+), 9 deletions(-) diff --git a/woocommerce-gateway-billmate/class-billmate-account.php b/woocommerce-gateway-billmate/class-billmate-account.php index 341f7738..e284df13 100755 --- a/woocommerce-gateway-billmate/class-billmate-account.php +++ b/woocommerce-gateway-billmate/class-billmate-account.php @@ -415,8 +415,63 @@ function get_title(){ global $woocommerce; if(is_object($woocommerce->cart)) { + $cart_total = $woocommerce->cart->total; - $pclasses = get_option('wc_gateway_billmate_partpayment_pclasses'); + + + + + + $settings = get_option('woocommerce_billmate_partpayment_settings'); + if ($settings['testmode'] == 'yes'): + // Disable SSL if in testmode + $billmate_ssl = 'false'; + $billmate_mode = 'test'; + else : + // Set SSL if used in webshop + if (is_ssl()) { + $billmate_ssl = 'true'; + } else { + $billmate_ssl = 'false'; + } + $billmate_mode = 'live'; + endif; + $eid = (int)get_option('billmate_common_eid'); + + if (empty($eid)) { + return false; + } + + $secret = get_option('billmate_common_secret'); + $country = self::$country; + $currency = get_woocommerce_currency(); + $language = explode('_', get_locale()); + if (!defined('BILLMATE_LANGUAGE')) define('BILLMATE_LANGUAGE', strtolower($language[0])); + global $wp_version; + + // Meta to add to API requests, will be used for debug + $meta = array( + 'PHP_VERSION' => phpversion(), + 'WORDPRESS_VERSION' => $wp_version, + 'WOOCOMMERCE_VERSION' => WC_VERSION + ); + $bm = new BillMate($eid, $secret, true, $settings['testmode'] == 'yes', false, $meta); + + $values['PaymentData'] = array( + 'currency' => $currency, + 'language' => $language[0], + 'country' => $country, + 'totalwithtax' => WC_Payment_Gateway::get_order_total() * 100 + ); + + $pclasses = $bm->getPaymentPlans($values); + + + + + + + $flags = BillmateFlags::CHECKOUT_PAGE; $pclass = BillmateCalc::getCheapestPClass($cart_total, $flags, $pclasses); $billmate_partpayment_monthly_cost_message = false; @@ -518,6 +573,8 @@ function is_available() { $sum -= ($availableFees[sanitize_title(__('Invoice fee','billmate'))]['amount'] + $availableFees[sanitize_title(__('Invoice fee','billmate'))]['tax']); } + $sum = $sum*100; + foreach ($pclasses as $pclass) { if (strlen($pclass['description']) > 0 ) { // If sum over minamount and not over maxamount or maxamount is 0 @@ -628,7 +685,8 @@ function update_billmatepclasses_from_billmate( ) { 'country' => strtolower($country) ) ); - $data = $k->getPaymentplans($values); + + $data = $k->getPaymentplans($values); if(!is_array($data)){ throw new Exception($data); } @@ -669,7 +727,7 @@ function update_billmatepclasses_from_billmate( ) { */ function payment_fields( ) { - global $woocommerce; + global $woocommerce; $enabled_plcass = 'no'; // Test mode or Live mode @@ -987,7 +1045,8 @@ public static function update_billmatepclasses_from_frontend(){ 'country' => strtolower($country) ) ); - $data = $k->getPaymentplans($values); + + $data = $k->getPaymentplans($values); if(!is_array($data)){ throw new Exception($data); } @@ -1026,7 +1085,7 @@ public static function payment_fields_options( $sum, $label = true ,$flag = Bill $pclasses_not_available = true; $enabled_plcass = 'no'; - $pclasses = get_option('wc_gateway_billmate_partpayment_pclasses',false); + $pclasses = $bm->getPaymentPlans($values); if(date('Y-m-d',strtotime('+1 week')) >= $pclasses[0]['expirydate']){ $_GET['billmatePclassListener'] = 1; self::update_billmatepclasses_from_frontend(); @@ -1049,7 +1108,7 @@ public static function payment_fields_options( $sum, $label = true ,$flag = Bill 'sv', 'country' => 'se' ); - $result = $billmate->getPaymentplans($values); - $response = array(); - if(isset($result['code']) && ($result['code'] == 9013 || $result['code'] == 9010 || $result['code'] == 9012)){ + + $result = $billmate->getPaymentplans($values); + $response = array(); + if(isset($result['code']) && ($result['code'] == 9013 || $result['code'] == 9010 || $result['code'] == 9012)) { $response['success'] = false; } else{ From 9c0ac9a2ca7c8398b551dd30cd22067ff11c8510 Mon Sep 17 00:00:00 2001 From: henrik-ecomatic Date: Tue, 3 Sep 2019 15:24:11 +0200 Subject: [PATCH 02/11] WPM-68 [BUGFIX] Fixed cherry-pick conflicts --- .../class-billmate-account.php | 457 ++++++++++++------ 1 file changed, 316 insertions(+), 141 deletions(-) diff --git a/woocommerce-gateway-billmate/class-billmate-account.php b/woocommerce-gateway-billmate/class-billmate-account.php index e284df13..5eb35b6c 100755 --- a/woocommerce-gateway-billmate/class-billmate-account.php +++ b/woocommerce-gateway-billmate/class-billmate-account.php @@ -420,54 +420,60 @@ function get_title(){ + $storedPclassesSum = WC()->session->get('billmate_pclasses_sum'); + $storedPclasses = WC()->session->get('billmate_pclasses'); + if ($storedPclasses == null || $storedPclassesSum !== WC_Payment_Gateway::get_order_total()*100) { - $settings = get_option('woocommerce_billmate_partpayment_settings'); - if ($settings['testmode'] == 'yes'): - // Disable SSL if in testmode - $billmate_ssl = 'false'; - $billmate_mode = 'test'; - else : - // Set SSL if used in webshop - if (is_ssl()) { - $billmate_ssl = 'true'; - } else { + $settings = get_option('woocommerce_billmate_partpayment_settings'); + if ($settings['testmode'] == 'yes'): + // Disable SSL if in testmode $billmate_ssl = 'false'; + $billmate_mode = 'test'; + else : + // Set SSL if used in webshop + if (is_ssl()) { + $billmate_ssl = 'true'; + } else { + $billmate_ssl = 'false'; + } + $billmate_mode = 'live'; + endif; + $eid = (int)get_option('billmate_common_eid'); + + if (empty($eid)) { + return false; } - $billmate_mode = 'live'; - endif; - $eid = (int)get_option('billmate_common_eid'); - if (empty($eid)) { - return false; + $secret = get_option('billmate_common_secret'); + $country = self::$country; + $currency = get_woocommerce_currency(); + $language = explode('_', get_locale()); + if (!defined('BILLMATE_LANGUAGE')) define('BILLMATE_LANGUAGE', strtolower($language[0])); + global $wp_version; + + // Meta to add to API requests, will be used for debug + $meta = array( + 'PHP_VERSION' => phpversion(), + 'WORDPRESS_VERSION' => $wp_version, + 'WOOCOMMERCE_VERSION' => WC_VERSION + ); + $bm = new BillMate($eid, $secret, true, $settings['testmode'] == 'yes', false, $meta); + + $values['PaymentData'] = array( + 'currency' => $currency, + 'language' => $language[0], + 'country' => $country, + 'totalwithtax' => WC_Payment_Gateway::get_order_total() * 100 + ); + $pclasses = $bm->getPaymentPlans($values); + + WC()->session->set('billmate_pclasses_sum', WC_Payment_Gateway::get_order_total() * 100); + WC()->session->set('billmate_pclasses', $pclasses); + } + else { + $pclasses = $storedPclasses; } - - $secret = get_option('billmate_common_secret'); - $country = self::$country; - $currency = get_woocommerce_currency(); - $language = explode('_', get_locale()); - if (!defined('BILLMATE_LANGUAGE')) define('BILLMATE_LANGUAGE', strtolower($language[0])); - global $wp_version; - - // Meta to add to API requests, will be used for debug - $meta = array( - 'PHP_VERSION' => phpversion(), - 'WORDPRESS_VERSION' => $wp_version, - 'WOOCOMMERCE_VERSION' => WC_VERSION - ); - $bm = new BillMate($eid, $secret, true, $settings['testmode'] == 'yes', false, $meta); - - $values['PaymentData'] = array( - 'currency' => $currency, - 'language' => $language[0], - 'country' => $country, - 'totalwithtax' => WC_Payment_Gateway::get_order_total() * 100 - ); - - $pclasses = $bm->getPaymentPlans($values); - - - @@ -549,8 +555,61 @@ function is_available() { } $pclasses_not_available = true; - $pclasses = get_option('wc_gateway_billmate_partpayment_pclasses',false); + $storedPclassesSum = WC()->session->get('billmate_pclasses_sum'); + $storedPclasses = WC()->session->get('billmate_pclasses'); + + if ($storedPclasses == null || $storedPclassesSum !== WC_Payment_Gateway::get_order_total()*100) { + $settings = get_option('woocommerce_billmate_partpayment_settings'); + + if ($settings['testmode'] == 'yes'): + // Disable SSL if in testmode + $billmate_ssl = 'false'; + $billmate_mode = 'test'; + else : + // Set SSL if used in webshop + if (is_ssl()) { + $billmate_ssl = 'true'; + } else { + $billmate_ssl = 'false'; + } + $billmate_mode = 'live'; + endif; + $eid = (int)get_option('billmate_common_eid'); + + if (empty($eid)) { + return false; + } + $secret = get_option('billmate_common_secret'); + $country = self::$country; + $currency = get_woocommerce_currency(); + $language = explode('_', get_locale()); + if (!defined('BILLMATE_LANGUAGE')) define('BILLMATE_LANGUAGE', strtolower($language[0])); + global $wp_version; + + // Meta to add to API requests, will be used for debug + $meta = array( + 'PHP_VERSION' => phpversion(), + 'WORDPRESS_VERSION' => $wp_version, + 'WOOCOMMERCE_VERSION' => WC_VERSION + ); + $bm = new BillMate($eid, $secret, true, $settings['testmode'] == 'yes', false, $meta); + + $values['PaymentData'] = array( + 'currency' => $currency, + 'language' => $language[0], + 'country' => $country, + 'totalwithtax' => WC_Payment_Gateway::get_order_total() * 100 + ); + + $pclasses = $bm->getPaymentPlans($values); + + WC()->session->set('billmate_pclasses_sum', WC_Payment_Gateway::get_order_total() * 100); + WC()->session->set('billmate_pclasses', $pclasses); + } + else { + $pclasses = $storedPclasses; + } if($pclasses){ $billmate_cart_total = WC_Payment_Gateway::get_order_total(); $sum = apply_filters( 'billmate_cart_total', $billmate_cart_total ); // Cart total. @@ -790,7 +849,61 @@ function payment_fields( ) { session->get('billmate_pclasses_sum'); + $storedPclasses = WC()->session->get('billmate_pclasses'); + + if ($storedPclasses == null || $storedPclassesSum !== $sum*100) { + $settings = get_option('woocommerce_billmate_partpayment_settings'); + + if ($settings['testmode'] == 'yes'): + // Disable SSL if in testmode + $billmate_ssl = 'false'; + $billmate_mode = 'test'; + else : + // Set SSL if used in webshop + if (is_ssl()) { + $billmate_ssl = 'true'; + } else { + $billmate_ssl = 'false'; + } + $billmate_mode = 'live'; + endif; + $eid = (int)get_option('billmate_common_eid'); + + if (empty($eid)) { + return false; + } + + $secret = get_option('billmate_common_secret'); + $country = self::$country; + $currency = get_woocommerce_currency(); + $language = explode('_', get_locale()); + if (!defined('BILLMATE_LANGUAGE')) define('BILLMATE_LANGUAGE', strtolower($language[0])); + global $wp_version; + + // Meta to add to API requests, will be used for debug + $meta = array( + 'PHP_VERSION' => phpversion(), + 'WORDPRESS_VERSION' => $wp_version, + 'WOOCOMMERCE_VERSION' => WC_VERSION + ); + $bm = new BillMate($eid, $secret, true, $settings['testmode'] == 'yes', false, $meta); + + $values['PaymentData'] = array( + 'currency' => $currency, + 'language' => $language[0], + 'country' => $country, + 'totalwithtax' => $sum * 100 + ); + + $pclasses = $bm->getPaymentPlans($values); + WC()->session->set('billmate_pclasses_sum', $sum * 100); + WC()->session->set('billmate_pclasses', $pclasses); + } + else { + $pclasses = $storedPclasses; + } if(!$pclasses) return false; /*$pclass = BillmateCalc::getCheapestPClass($sum, $flag, $pclasses); @@ -1081,11 +1194,65 @@ public static function update_billmatepclasses_from_frontend(){ **/ public static function payment_fields_options( $sum, $label = true ,$flag = BillmateFlags::CHECKOUT_PAGE){ + $pclasses_not_available = true; + $enabled_plcass = 'no'; + $storedPclassesSum = WC()->session->get('billmate_pclasses_sum'); + $storedPclasses = WC()->session->get('billmate_pclasses'); + + if ($storedPclasses == null || $storedPclassesSum !== $sum*100) { + $settings = get_option('woocommerce_billmate_partpayment_settings'); + + if ($settings['testmode'] == 'yes'): + // Disable SSL if in testmode + $billmate_ssl = 'false'; + $billmate_mode = 'test'; + else : + // Set SSL if used in webshop + if (is_ssl()) { + $billmate_ssl = 'true'; + } else { + $billmate_ssl = 'false'; + } + $billmate_mode = 'live'; + endif; + $eid = (int)get_option('billmate_common_eid'); + + if (empty($eid)) { + return false; + } + + $secret = get_option('billmate_common_secret'); + $country = self::$country; + $currency = get_woocommerce_currency(); + $language = explode('_', get_locale()); + if (!defined('BILLMATE_LANGUAGE')) define('BILLMATE_LANGUAGE', strtolower($language[0])); + global $wp_version; + + // Meta to add to API requests, will be used for debug + $meta = array( + 'PHP_VERSION' => phpversion(), + 'WORDPRESS_VERSION' => $wp_version, + 'WOOCOMMERCE_VERSION' => WC_VERSION + ); + $bm = new BillMate($eid, $secret, true, $settings['testmode'] == 'yes', false, $meta); + + $values['PaymentData'] = array( + 'currency' => $currency, + 'language' => $language[0], + 'country' => $country, + 'totalwithtax' => $sum * 100 + ); $pclasses_not_available = true; $enabled_plcass = 'no'; - $pclasses = $bm->getPaymentPlans($values); + $pclasses = $bm->getPaymentPlans($values); + WC()->session->set('billmate_pclasses_sum', $sum * 100); + WC()->session->set('billmate_pclasses', $pclasses); + } + else { + $pclasses = $storedPclasses; + } if(date('Y-m-d',strtotime('+1 week')) >= $pclasses[0]['expirydate']){ $_GET['billmatePclassListener'] = 1; self::update_billmatepclasses_from_frontend(); @@ -1099,6 +1266,62 @@ public static function payment_fields_options( $sum, $label = true ,$flag = Bill $pclasses = array($pclasses); $flag = BillmateFlags::CHECKOUT_PAGE; } + + $storedPclassesSum = WC()->session->get('billmate_pclasses_sum'); + $storedPclasses = WC()->session->get('billmate_pclasses'); + + if ($storedPclasses == null || $storedPclassesSum !== $sum*100) { + $settings = get_option('woocommerce_billmate_partpayment_settings'); + + if ($settings['testmode'] == 'yes'): + // Disable SSL if in testmode + $billmate_ssl = 'false'; + $billmate_mode = 'test'; + else : + // Set SSL if used in webshop + if (is_ssl()) { + $billmate_ssl = 'true'; + } else { + $billmate_ssl = 'false'; + } + $billmate_mode = 'live'; + endif; + $eid = (int)get_option('billmate_common_eid'); + + if (empty($eid)) { + return false; + } + + $secret = get_option('billmate_common_secret'); + $country = self::$country; + $currency = get_woocommerce_currency(); + $language = explode('_', get_locale()); + if (!defined('BILLMATE_LANGUAGE')) define('BILLMATE_LANGUAGE', strtolower($language[0])); + global $wp_version; + + // Meta to add to API requests, will be used for debug + $meta = array( + 'PHP_VERSION' => phpversion(), + 'WORDPRESS_VERSION' => $wp_version, + 'WOOCOMMERCE_VERSION' => WC_VERSION + ); + $bm = new BillMate($eid, $secret, true, $settings['testmode'] == 'yes', false, $meta); + + $values['PaymentData'] = array( + 'currency' => $currency, + 'language' => $language[0], + 'country' => $country, + 'totalwithtax' => $sum * 100 + ); + + $pclasses = $bm->getPaymentPlans($values); + WC()->session->set('billmate_pclasses_sum', $sum * 100); + WC()->session->set('billmate_pclasses', $pclasses); + } + else { + $pclasses = $storedPclasses; + } + // Check if we have any PClasses if(!$pclasses_not_available) { if( $label ) { @@ -2021,111 +2244,63 @@ static function print_product_monthly_cost() { //global $woocommerce, $product, $billmate_partpayment_shortcode_currency, $billmate_partpayment_shortcode_price, $billmate_partpayment_shortcode_img, $billmate_partpayment_shortcode_info_link; global $woocommerce, $product, $billmate_partpayment_shortcode_currency, $billmate_partpayment_shortcode_price, $billmate_shortcode_img, $billmate_partpayment_country,$billmate_partpayment_eid; - $pclasses = get_option('wc_gateway_billmate_partpayment_pclasses',false); - $billmate_partpayment_eid = $eid; - - // Only execute this if the feature is activated in the gateway settings - if ( $show_monthly_cost == 'yes' && is_array($pclasses) ) { - - // Test mode or Live mode - if ( $testmode == 'yes' ): - // Disable SSL if in testmode - $billmate_ssl = 'false'; - $billmate_mode = 'test'; - else : - // Set SSL if used in webshop - if (is_ssl()) { - $billmate_ssl = 'true'; - } else { - $billmate_ssl = 'false'; - } - $billmate_mode = 'live'; - endif; - - $pcURI = BILLMATE_DIR . 'srv/billmatepclasses.json'; - $pclasses_not_available = true; - if($pclasses) $pclasses_not_available = false; + $storedPclassesSum = WC()->session->get('billmate_pclasses_sum'); + $storedPclasses = WC()->session->get('billmate_pclasses'); + if ($storedPclasses == null || $storedPclassesSum !== WC_Payment_Gateway::get_order_total()*100) { - // apply_filters to product price so we can filter this if needed - $billmate_product_total = $product->get_price(); - $sum = apply_filters( 'billmate_product_total', $billmate_product_total ); // Product price. - $flag = BillmateFlags::PRODUCT_PAGE; //or BillmateFlags::PRODUCT_PAGE, if you want to do it for one item. - $pclass = BillmateCalc::getCheapestPClass($sum, $flag, $pclasses); - - - //Did we get a PClass? (it is false if we didn't) - if($pclass) { - //Here we reuse the same values as above: - $value = BillmateCalc::calc_monthly_cost( - $sum, - $pclass, - $flag - ); - - /* $value is now a rounded monthly cost amount to be displayed to the customer. */ - if ( $lower_threshold_monthly_cost < $sum && $upper_threshold_monthly_cost > $sum ) { - - // Asign values to variables used for shortcodes. - $billmate_partpayment_shortcode_currency = $billmate_currency; - $billmate_partpayment_shortcode_price = $value; - $billmate_shortcode_img = $icon_basic; - $billmate_partpayment_country = $billmate_country; - - echo '
' . do_shortcode( $show_monthly_cost_info ); - echo '
'; - - } - - } // End pclass check + $settings = get_option('woocommerce_billmate_partpayment_settings'); - } // End show_monthly_cost check + if ($settings['testmode'] == 'yes'): + // Disable SSL if in testmode + $billmate_ssl = 'false'; + $billmate_mode = 'test'; + else : + // Set SSL if used in webshop + if (is_ssl()) { + $billmate_ssl = 'true'; + } else { + $billmate_ssl = 'false'; + } + $billmate_mode = 'live'; + endif; + $eid = (int)get_option('billmate_common_eid'); - } + if (empty($eid)) { + return false; + } + $secret = get_option('billmate_common_secret'); + $country = self::$country; + if ($country != "SE" && $country != "NO" && $country != "DK" && $country != "FI" && $country != "DE" && $country != "NL") { + $country = "SE"; + } + $currency = get_woocommerce_currency(); + $language = explode('_', get_locale()); + if (!defined('BILLMATE_LANGUAGE')) define('BILLMATE_LANGUAGE', strtolower($language[0])); + global $wp_version; - /** - * Calc monthly cost on Shop page and print it out - **/ + // Meta to add to API requests, will be used for debug + $meta = array( + 'PHP_VERSION' => phpversion(), + 'WORDPRESS_VERSION' => $wp_version, + 'WOOCOMMERCE_VERSION' => WC_VERSION + ); + $bm = new BillMate($eid, $secret, true, $settings['testmode'] == 'yes', false, $meta); - function print_product_monthly_cost_shop() { + $values['PaymentData'] = array( + 'currency' => $currency, + 'language' => $language[0], + 'country' => $country, + 'totalwithtax' => $product->get_price() * 100 + ); - if ( $this->enabled!="yes" ) return; - if (!in_array(get_option('woocommerce_currency'), array('SEK')) OR get_woocommerce_currency() != 'SEK') { - return false; + $pclasses = $bm->getPaymentPlans($values); } - //global $woocommerce, $product, $billmate_partpayment_shortcode_currency, $billmate_partpayment_shortcode_price, $billmate_partpayment_shortcode_img, $billmate_partpayment_shortcode_info_link; - global $woocommerce, $product, $billmate_partpayment_shortcode_currency, $billmate_partpayment_shortcode_price, $billmate_shortcode_img, $billmate_partpayment_country; - - $pclasses = get_option('wc_gateway_billmate_partpayment_pclasses',false); - - // Only execute this if the feature is activated in the gateway settings - if ( $this->show_monthly_cost_shop == 'yes' && is_array($pclasses) ) { - - // Test mode or Live mode - if ( $this->testmode == 'yes' ): - // Disable SSL if in testmode - $billmate_ssl = 'false'; - $billmate_mode = 'test'; - else : - // Set SSL if used in webshop - if (is_ssl()) { - $billmate_ssl = 'true'; - } else { - $billmate_ssl = 'false'; - } - $billmate_mode = 'live'; - endif; - if( empty( $this->eid) ){ - return false; - } - - $eid = (int)$this->eid; - $secret = $this->secret; - $country = $this->billmate_country; - $language = $this->billmate_language; - $currency = $this->billmate_currency; - + else { + $pclasses = $storedPclasses; + } + $billmate_partpayment_eid = $eid; $k = new BillMate( $eid, $secret, true, false, $this->testmode == 'yes', false, $this->getRequestMeta() ); From 93d6cbebdf71568de61b41f7d145226bc3f865c6 Mon Sep 17 00:00:00 2001 From: henrik-ecomatic Date: Wed, 13 Nov 2019 15:36:05 +0100 Subject: [PATCH 03/11] WPM-78 [BUGFIX] fixed issue where changing shipping method on cart page disabled redirect to billmate checkout --- woocommerce-gateway-billmate/class-billmate-checkout.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/woocommerce-gateway-billmate/class-billmate-checkout.php b/woocommerce-gateway-billmate/class-billmate-checkout.php index aee7c2e2..f02a9178 100644 --- a/woocommerce-gateway-billmate/class-billmate-checkout.php +++ b/woocommerce-gateway-billmate/class-billmate-checkout.php @@ -132,7 +132,9 @@ public function get_title() { function change_to_bco($url){ if (array_key_exists('payment', $_GET) || array_key_exists('wc-ajax', $_GET)){ - return $url; + if ($_GET['wc-ajax'] == 'get_refreshed_fragments') { + return $url; + } } if(!is_admin()) { if($this->enabled == 'yes') { From 8b378139081f969a1b023dd57c0df6a181925f6d Mon Sep 17 00:00:00 2001 From: henrik-ecomatic Date: Wed, 13 Nov 2019 15:51:41 +0100 Subject: [PATCH 04/11] WPM-78 [BUGFIX] fixed redirect to billmate checkout and successpage --- .../class-billmate-checkout.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/woocommerce-gateway-billmate/class-billmate-checkout.php b/woocommerce-gateway-billmate/class-billmate-checkout.php index f02a9178..c135bfe8 100644 --- a/woocommerce-gateway-billmate/class-billmate-checkout.php +++ b/woocommerce-gateway-billmate/class-billmate-checkout.php @@ -131,11 +131,16 @@ public function get_title() { } function change_to_bco($url){ - if (array_key_exists('payment', $_GET) || array_key_exists('wc-ajax', $_GET)){ - if ($_GET['wc-ajax'] == 'get_refreshed_fragments') { - return $url; + $redirect = true; + $traces = debug_backtrace(); + foreach ($traces as $trace){ + if ($trace['function'] == 'get_checkout_order_received_url'){ + $redirect = false; } } + if (array_key_exists('payment', $_GET) || !$redirect){ + return $url; + } if(!is_admin()) { if($this->enabled == 'yes') { if("sv" == strtolower(current(explode('_',get_locale())))) { From 44843ddc55e9f837995488af664bc52d122a68cd Mon Sep 17 00:00:00 2001 From: henrik-ecomatic Date: Fri, 15 Nov 2019 11:59:57 +0100 Subject: [PATCH 05/11] WPM-78 [BUGFIX] Fixed invoice fee when using billmate checkout --- .../gateway-billmate.php | 71 ++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/woocommerce-gateway-billmate/gateway-billmate.php b/woocommerce-gateway-billmate/gateway-billmate.php index ea7b16fa..c208446c 100755 --- a/woocommerce-gateway-billmate/gateway-billmate.php +++ b/woocommerce-gateway-billmate/gateway-billmate.php @@ -741,7 +741,76 @@ public function common_check_ipn_response($config = array()) { } else { $method_title = $method_title . ' (' . $billmateOrder['PaymentData']['method_name'] . ')'; } - } else { + } + else if (isset($billmateOrder['Cart']['Handling']['withouttax']) AND isset($billmateOrder['Cart']['Handling']['taxrate'])) { + + $billmateInvoice = new WC_Gateway_Billmate_Invoice(); + $invoice_fee = $billmateInvoice->invoice_fee; + $invoice_fee_tax_class = $billmateInvoice->invoice_fee_tax_class; + + $feeTaxrate = intval($billmateOrder['Cart']['Handling']['taxrate']); + + $feeAmount = intval($billmateOrder['Cart']['Handling']['withouttax']); + if ($feeAmount > 0) { + $feeAmount /= 100; + } + + $feeTax = 0; + if ($feeTaxrate > 0) { + $feeTax = ($feeAmount * (1 + ($feeTaxrate / 100))) - $feeAmount; + } + + + // Handling fee tax rates + $tax = new WC_Tax(); + $rates = $tax->get_rates($invoice_fee_tax_class); + $rate = $rates; + $rate = array_pop($rate); + $rate = $rate['rate']; + + $feeTaxdata = array(); + foreach ($rates AS $i => $rate) { + $feeTaxdata[$i] = wc_format_decimal(0); + if ($rate['rate'] > 0) { + $feeTaxdata[$i] = wc_format_decimal(($feeAmount * (1 + ($rate['rate'] / 100))) - $feeAmount); + } + } + + $fee = new stdClass(); + $fee->name = __('Invoice fee', 'billmate'); + $fee->tax_class = $invoice_fee_tax_class; + $fee->taxable = ($feeTax > 0) ? true : false; + $fee->amount = wc_format_decimal($feeAmount); + $fee->tax = wc_format_decimal($feeTax); + $fee->tax_data = $feeTaxdata; + + if (version_compare(WC_VERSION, '3.0.0', '>=')) { + $item = new WC_Order_Item_Fee(); + $item->set_props(array( + 'name' => $fee->name, + 'tax_class' => $fee->tax_class, + 'total' => $fee->amount, + 'total_tax' => $fee->tax, + 'taxes' => array( + 'total' => $fee->tax_data, + ), + 'order_id' => $order->get_id(), + )); + + $item->save(); + $order->add_item($item); + $item_id = $item->get_id(); + + $order->calculate_totals(); // Recalculate order totals after fee is added + + } else { + $item_id = $order->add_fee($fee); + } + $order->calculate_taxes(); + $order->calculate_totals(); + } + else + { $method_title = $method_title . ' (' . $billmateOrder['PaymentData']['method_name'] . ')'; } } From 2090dcdf339c2d3ccada7e0ed257bf39e7870852 Mon Sep 17 00:00:00 2001 From: henrik-ecomatic Date: Mon, 18 Nov 2019 11:16:44 +0100 Subject: [PATCH 06/11] WPM-78 [BUGFIX] added check to ensure that invoice fee is not added twice --- .../gateway-billmate.php | 50 ++++++++++++------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/woocommerce-gateway-billmate/gateway-billmate.php b/woocommerce-gateway-billmate/gateway-billmate.php index c208446c..f87fcc8f 100755 --- a/woocommerce-gateway-billmate/gateway-billmate.php +++ b/woocommerce-gateway-billmate/gateway-billmate.php @@ -785,26 +785,40 @@ public function common_check_ipn_response($config = array()) { $fee->tax_data = $feeTaxdata; if (version_compare(WC_VERSION, '3.0.0', '>=')) { - $item = new WC_Order_Item_Fee(); - $item->set_props(array( - 'name' => $fee->name, - 'tax_class' => $fee->tax_class, - 'total' => $fee->amount, - 'total_tax' => $fee->tax, - 'taxes' => array( - 'total' => $fee->tax_data, - ), - 'order_id' => $order->get_id(), - )); - - $item->save(); - $order->add_item($item); - $item_id = $item->get_id(); - - $order->calculate_totals(); // Recalculate order totals after fee is added + $run = true; + if ($order->get_meta('billmate_has_applied_invoice_fee', true) == 1){ + $run = false; + } + if ($run) { + $item = new WC_Order_Item_Fee(); + $item->set_props(array( + 'name' => $fee->name, + 'tax_class' => $fee->tax_class, + 'total' => $fee->amount, + 'total_tax' => $fee->tax, + 'taxes' => array( + 'total' => $fee->tax_data, + ), + 'order_id' => $order->get_id(), + )); + + $item->save(); + $order->add_item($item); + $item_id = $item->get_id(); + + $order->calculate_totals(); // Recalculate order totals after fee is added + $order->update_meta_data('billmate_has_applied_invoice_fee',1); + } } else { - $item_id = $order->add_fee($fee); + $run = true; + if ($order->get_meta('billmate_has_applied_invoice_fee', true) == 1){ + $run = false; + } + if ($run) { + $item_id = $order->add_fee($fee); + $order->update_meta_data('billmate_has_applied_invoice_fee',1); + } } $order->calculate_taxes(); $order->calculate_totals(); From 556f885d60a4b0fe2fc8faa995bcb36f627f5253 Mon Sep 17 00:00:00 2001 From: henrik-ecomatic Date: Mon, 18 Nov 2019 11:49:20 +0100 Subject: [PATCH 07/11] WPM-78 [CLEANUP] Removed the need for an aditional field on order to avoid double invoice fees --- woocommerce-gateway-billmate/gateway-billmate.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/woocommerce-gateway-billmate/gateway-billmate.php b/woocommerce-gateway-billmate/gateway-billmate.php index f87fcc8f..ef57c41c 100755 --- a/woocommerce-gateway-billmate/gateway-billmate.php +++ b/woocommerce-gateway-billmate/gateway-billmate.php @@ -786,7 +786,7 @@ public function common_check_ipn_response($config = array()) { if (version_compare(WC_VERSION, '3.0.0', '>=')) { $run = true; - if ($order->get_meta('billmate_has_applied_invoice_fee', true) == 1){ + if ($order->get_meta('billmate_invoice_id', true) == $data['number']){ $run = false; } if ($run) { @@ -807,17 +807,15 @@ public function common_check_ipn_response($config = array()) { $item_id = $item->get_id(); $order->calculate_totals(); // Recalculate order totals after fee is added - $order->update_meta_data('billmate_has_applied_invoice_fee',1); } } else { $run = true; - if ($order->get_meta('billmate_has_applied_invoice_fee', true) == 1){ + if ($order->get_meta('billmate_invoice_id', true) == $data['number']){ $run = false; } if ($run) { $item_id = $order->add_fee($fee); - $order->update_meta_data('billmate_has_applied_invoice_fee',1); } } $order->calculate_taxes(); From 4079a3c2cc4369cfd58214f126722f3bbc9b2e3a Mon Sep 17 00:00:00 2001 From: henrik-ecomatic Date: Mon, 18 Nov 2019 16:19:42 +0100 Subject: [PATCH 08/11] WPM-78 [BUGFIX] restored aditional field on order as it did not work with pending orders --- woocommerce-gateway-billmate/gateway-billmate.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/woocommerce-gateway-billmate/gateway-billmate.php b/woocommerce-gateway-billmate/gateway-billmate.php index ef57c41c..f87fcc8f 100755 --- a/woocommerce-gateway-billmate/gateway-billmate.php +++ b/woocommerce-gateway-billmate/gateway-billmate.php @@ -786,7 +786,7 @@ public function common_check_ipn_response($config = array()) { if (version_compare(WC_VERSION, '3.0.0', '>=')) { $run = true; - if ($order->get_meta('billmate_invoice_id', true) == $data['number']){ + if ($order->get_meta('billmate_has_applied_invoice_fee', true) == 1){ $run = false; } if ($run) { @@ -807,15 +807,17 @@ public function common_check_ipn_response($config = array()) { $item_id = $item->get_id(); $order->calculate_totals(); // Recalculate order totals after fee is added + $order->update_meta_data('billmate_has_applied_invoice_fee',1); } } else { $run = true; - if ($order->get_meta('billmate_invoice_id', true) == $data['number']){ + if ($order->get_meta('billmate_has_applied_invoice_fee', true) == 1){ $run = false; } if ($run) { $item_id = $order->add_fee($fee); + $order->update_meta_data('billmate_has_applied_invoice_fee',1); } } $order->calculate_taxes(); From f742bca1ad0c58df90e798e8ad3f86df21bf9cc9 Mon Sep 17 00:00:00 2001 From: Mattias Nilsson Date: Tue, 19 Nov 2019 07:46:30 +0100 Subject: [PATCH 09/11] [TASK] Remove unneeded changelog.md as it already exits in src/Readme.txt --- changelog.md | 322 --------------------------------------------------- 1 file changed, 322 deletions(-) delete mode 100644 changelog.md diff --git a/changelog.md b/changelog.md deleted file mode 100644 index 6c99e50c..00000000 --- a/changelog.md +++ /dev/null @@ -1,322 +0,0 @@ -# Changelog - -## 3.6.0 (2019-11-13) -* Feature - Selected payment method in Billmate Checkout is shown in WooCommerce order details -* Fix - Aditional rules for checkout url to not be overwritten by billmatecheckout url - -## 3.5.1 (2019-11-12) -* Fix - Checking orders for used coupons - -## 3.5.0 (2019-11-11) -* Fix - WooCommerce built-in Checkout are using Billmate's new logos -* Feature - Show/hide overlay in store when in Billmate Checkout - -## 3.4.18 (2019-11-08) -* Fix - Billmate Checkout page does not overwrite checkout page in WooCommerce settings - -## 3.4.17 (2019-11-06) -* Enhancement library file to use wordpress built-in functions instead of php curl - -## 3.4.16 (2019-11-04) -* Fix - plugin to comply with Wordpress standards -* Enhancement Added security and input sanitation - -## 3.4.15 (2019-10-30) - * Fix - Sanitization issues - -## 3.4.14 (2019-10-24) - * Fix - Revert back - loopback health problem - -## 3.4.13 (2019-10-23) - * Fix - Revert back to 3.4.11 state - -## 3.4.12 (2019-10-18) - * Enhancement - Discount Code - * Tweak - Remove pre-check from Invoice/Partpayment email validation checkbox - * Fix - Loopback request that failure in WP built in site health - -## 3.4.11 (2019-10-04) - * Fix - WooCommerce built-in Checkout are using Billmate's new logos - -## 3.4.10 (2019-09-27) - * Fix - Reverse back to 3.4.7 state - -## 3.4.7 (2019-07-15) - * Fix - WhooCommerce built-in checkout use Billmates new logos - * Fix WhooCommerce shows correct company delivery address - * Fix Wocommerce Subription sets the currency based on the order instead of the defualt currency - -## 3.4.6 (2019-05-22) -* Fix - Removed browser scrolls to Billmate Checkout after refresh - -## 3.4.5 (2019-05-20) -* Fix - Clear Billmate Checkout Session after a payment is made - -## 3.4.4 (2019-03-05) -* Enhancement - Only get Billmate Checkout page when language is sv -* Fix - Only define WOOCOMMERCE_CHECKOUT on Billmate Checkout page -* Fix - Fix product partpayment info_link shortcode url - -## 3.4.3 (2019-01-16) -* Enhancement - HTML decode order item titles -* Enhancement - Keep Billmate Checkout in sync when multiple browser tabs -* Fix - Fix subscription with invoice when not test mode -* Fix - Add generic support for sequental order number - -## 3.4.2 (2019-01-08) -* Fix - Check if cart exists before checking if having items in stock -* Fix - Prevent invoice pno validation on store checkout page load -* Fix - Prevent duplicated wc checkout error messages - -## 3.4.1 (2019-01-07) -* Enhancement - Add trigger JS event getaddresserror -* Enhancement - Add tested WooCommerce version 3.5 -* Tweak - Remove pre-check from Invoice/Partpayment email validation checkbox -* Fix - Improve support for sequential order numbers -* Fix - Fix undefined variables on Billmate Checkout page -* Refactor - Move logic of hide payment option pno input to backend - -## 3.4.0 (2018-10-15) -* Feature - Order Comments on Billamte Checkout page -* Feature - Invoice support for WooCommerce Subscription -* Feature - Show/hide overlay in store when in Billmate Checkout -* Enhancement - Improve open apps in IOS for Billmate Checkout -* Enhancement - Partpayment on product page also show when checkout is active -* Fix - Remove org.nr from Partpayment pno input label - -## 3.3.2 (2018-06-14) -* Fix - Check if session exists before try fetching customer postcode -* Enhancement - When saved address in Billmate Checkout Only update Checkout order when Shipping fee is affected -* Enhancement - Minor code refactoring Use same function to calculate shipping fee when update Checkout - -## 3.3.1 (2018-06-07) -* Fix - Use WooCommerce cart get tax functions when wc above version 3.2 -* Fix - Improve check if cart items is in stock -* Fix - Init new Billmate Checkout if current cant be found -* Enhancement - Decrease amount of API requests for Billmate Checkout -* Enhancement - Remove PaymentInfo.paymentdate from Billmate API requests - -## 3.3.0 (2018-05-24) -* Feature - Privacy policy support for payment methods and Billmate Checkout -* Fix - Do not display Billmate Checkout when cart have item out of stock -* Fix - User better method to get permalinks -* Enhancement - Tweak Billmate Checkout iframe permissions - -## 3.2.0 (2018-04-25) -* Feature - Support for WooCommerc cart shipping calculator for Billmate Checkout -* Feature - Show Select another payment button above Billmate Checkout when available -* Fix - Improve clear cart when complete order with Billmate Checkout -* Fix - Make sure file with function is_plugin_active is included -* Fix - Set custom order status when paid after order is set as paid -* Enhancement - Show paid with Billmate Checkout on order for recent version of WC -* Enhancement - Update store order address from Billmate checkout -* Enhancement - Improve admin notifications -* Enhancement - Improve remind administrator about admin settings - -## 3.1.1 (2018-01-29) -* Fix - Bank payments now always use the same string where it's referenced. -* Fix - Rounding improvements. Under some rare circumstances the amount can be different from payment window to callback and/or accept url. -* Enhancement - Improved loading animation for Checkout - The loading animation is more precise triggered when needed. -* Feature - Support for plugin "Product Add-Ons" in combination with Billmate Checkout. - -## 3.1.0 (2017-12-19) -* Fix - BC add handling fee on store order when set orderstatus is not default -* Fix - BC support for autoactivate order on creation -* Fix - Tax calculation when free shipping -* Enhancement - Improve rounding accuracy for prices set including tax and zero decimals -* Enhancement - WooCommerce subscription support for change card information and manually pay failed subscription order -* Enhancement - Invoice fee support for WPML currency -* Enhancement - Improve shipping tax calculation -* Enhancement - Replace Cardpayment logo - - -## 3.0.8 (2017-10-10) -* Fix - Fix order completed when not paid with Billmate - -## 3.0.7 (2017-10-09) -* Fix - Add missing handling fee on order paid with checkout and rely on callback -* Enhancement - Use method 2 if 1 is unavailable -* Fix - handle shipping with no tax -* Enhancement - Prevent cache of checkout page -* Enhancement - Improve error messages on order note if order activation not success -* Enhancement - Change order of getAddress to be done after try first with addPayment -* Fix - Add handling fee to store order when pay_for_order isset -* Fix - Display partpayment info on product page once - -## 3.0.6 (2017-09-14) -* Improve - Improve the selected currency check when display payment methods -* Improve - Support for additional get parameters -* Improve - Support for activate Billmate Checkout invoice on callback - -## 3.0.5 (2017-07-28) -* Fix - Improve Billmate Checkout speed and communication - -## 3.0.4 (2017-07-15) -* Fix - WooCommerce Subscription 2.2.8 compatibility -* Enhancement - Add links in plugin list - -## 3.0.3 (2017-06-12) -* Fix - Support discount 12% vat -* Enhancement - Discount can be on item level or order level -* Enhancement - Use order item name if standard product - -## 3.0.2 (2017-06-07) -* Fix - Improve compatibility with WC 3 -* Fix - Improve Billmate Checkout - -## 3.0.1 (2017-05-16) -* Fix - Improve compatibility with WC 3 -* Fix - Improve compatibility with PHP 7 -* Fix - Improve Billmate Checkout - -## 3.0 (2017-04-24) -* Feature - Add support for Billmate Checkout -* Fix - Prevent admin menu would be affected -* Fix - Prevent handling fee added as order item - -## 2.2.11 (2017-01-03) -* Fix - New Years issue with update payment plans. -* Fix - Payment link issue invoice and partpay. - -## 2.2.10 (2016-12-21) -* Fix - Abort payment, then do a new with same method. - -## 2.2.9 (2016-12-14) -* Fix - Adjust som styling in checkout for smaller devices -* Enhancement - Add product option to order -* Enhancement - Add additional fees to order as products - -## 2.2.8 (2016-11-18) -* Fix - Get address support for IE8 IE9 -* Enhancement - Display message in checkout when cancel/fail cardpayment -* Enhancement - Display message in checkout when cancel/fail bankpayment -* Enhancement - Links to manual in settings -* Enhancement - Button to reset Pclasses in settings - -## 2.2.7 (2016-08-05) -* Fix - Discount and VAT. - -## 2.2.6 (2016-04-07) -* Fix - Address popup utf8. -* Enhancement - Not send in zero fees. -* Enhancement - Fixed some rounding issues. - -## 2.2.5 (2016-03-21) -* Fix - Not send in Payment terms. - -## 2.2.4 (2016-02-29) -* Fix - Subscriptions -* Fix - Status for subscriptions. - -## 2.2.3 (2016-02-25) -* Fix - Callback with post. - -## 2.2.2 (2016-02-16) -* Fix - Exit after all redirects. - -## 2.2.1 (2016-02-12) -* Fix - Recurring number on order. - -## 2.2 (2016-01-08) -* Enhancement - Autoactivate invoices on complete. -* Enhancement - Compatibility with Woocommerce Subscription. Recurring payment. -* Translation - Improved the translations. -* Enhancement - Update totals on getAddress click. -* Engancement - Better tracking of invoices in order history. - -## 2.1.7(2016-01-21) -* Fix - Rounding totals. - -## 2.1.6(2015-12-10) -* Fix - Customer Nr. -* Fix - Compatibility wc_seq_order_number. - -## 2.1.5 (2015-12-09) -* Fix - Rounding. -* Fix - Callback issue. - -## 2.1.4 (2015-10-29) -* Fix - Fix bank and partpayment calculations. -* Enhancement - Change classname from Encoding to BillmateStringEncoding, compatibility with Duplicator Pro plugin. - -## 2.1.3 (2015-10-12) -* Fix - Php 5.4 compatibility, activate plugin issue. - -## 2.1.2 (2015-10-07) -* Fix - Activate plugin issue. -* Enhancement - Added filters for our icons. - -## 2.1.1 (2015-10-05) -* Fix - UTF-8 encoding, payment denied message and Card and Bank payment addresses. -* Fix - Rounding calculations. - -## 2.1 (2015-10-01) -* Enhancement - Possibility to Choose logo on the invoice created in Billmate Online. -* Optimization - Less load time when show partpayment from on product/shop page. -* Enhancement - Communication error messages. -* Fix - Cancel callback. - -## 2.0.6.2 (2015-09-25) -* Fix - Callback issue with GET setting -* Fix - Terms for invoice -* Fix - Sequential Order number compatibility - -## 2.0.6 (2015-09-04) -2 commits -* Fix - Order status when order is denied. -* Fix - Order note when order is denied. - -## 2.0.5 (2015-09-04) -2 commits -* Fix - Added transaction method on card again. - -## 2.0.4 (2015-08-24) -2 commits -* Enchancement - Prettified if no email is input in invoice and partpayment. -* Fix - Order status Issue with partpayment and invoice. - -## 2.0.3 (2015-08-17) -1 commit 2 issues closed. -* Enchangement - Clean up logging. -* Fix - Same encoding on all error messages. - -## 2.0.2 (2015-08-14) -1 commit -* Fix - Corrected a typo. - -## 2.0.1 (2015-08-13) -1 commit -* Compatibility - WooCommerce above 2.4 - -## 2.0 (2015-08-05) -110 commits and 79 issues closed. -* Compatibility - WooCommerce 2.0 and above. -* Enchancement - Get Address for customers in the Checkout. -* Tweak - Layout improvements. -* Tweak - Automatic update of paymentplans. -* Tweak - Clearify Invoice fee in Invoice payment title. -* Tweak - Validation of Billmate Credentials. -* Tweak - Can choose status of payment. -* Tweak - Remove need of product for the Invoice Fee. -* Fix - Consequent display of testmode. -* Fix - Added better support for plugin dynamic pricing. -* Fix - Discount is now divided per Vat rate. -* Fix - Can now order when create account on checkout. - -## 1.23.2 (2015-01-30) -* Fix - Fixed a bug that if you entered a matching adress, the verification of the adress popup still appeared. - -## 1.23.1 (2015-01-19) -* Fix - The payment status is set to the correct on all payment methods. - -## 1.23 (2015-01-08) -* Feature - Added the functionality so that if you put a file called billmatecustom.css in the plugin it will include that. Useful if you need to overwrite some CSS to make the Billmate plugin look good in you checkout without everwriting the themes css. -* Fix - Fixed so that an error on the checkout page does not occur if you enter wrong "personnummer" twice. -* Fix - If you enter a wroong ID for the invoice fee the checkout and settings page does not crash. -* Fix - Removed references to WPLANG and now uses get_locale function instead. According to Wordpres coding standard. -* Tweak - Updated to new company name : Billmate AB. -* Tweak - Change to correct include of colorbox.css to follow Wordpress coding standard -* Tweak - Fixed so that partpayment prices is shown as 12 mounths instead of 3 - ---- -Original code created by Niklas Högefjord - http://krokedil.com/ From 3b232dc36a893289057724413a4e4046d394c569 Mon Sep 17 00:00:00 2001 From: henrik-ecomatic Date: Tue, 19 Nov 2019 10:52:44 +0100 Subject: [PATCH 10/11] WPM-78 [BUGFIX] added code to set method title if order has invoice fee --- woocommerce-gateway-billmate/gateway-billmate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/woocommerce-gateway-billmate/gateway-billmate.php b/woocommerce-gateway-billmate/gateway-billmate.php index f87fcc8f..82f7bf23 100755 --- a/woocommerce-gateway-billmate/gateway-billmate.php +++ b/woocommerce-gateway-billmate/gateway-billmate.php @@ -743,7 +743,7 @@ public function common_check_ipn_response($config = array()) { } } else if (isset($billmateOrder['Cart']['Handling']['withouttax']) AND isset($billmateOrder['Cart']['Handling']['taxrate'])) { - + $method_title = $method_title . ' (' . $billmateOrder['PaymentData']['method_name'] . ')'; $billmateInvoice = new WC_Gateway_Billmate_Invoice(); $invoice_fee = $billmateInvoice->invoice_fee; $invoice_fee_tax_class = $billmateInvoice->invoice_fee_tax_class; From c1d4409e892db9793a8e4169bf69384a3f853015 Mon Sep 17 00:00:00 2001 From: Mattias Nilsson Date: Wed, 20 Nov 2019 10:26:14 +0100 Subject: [PATCH 11/11] [TASK] Update to version ''1.6.2'' --- src/Readme.txt | 4 ++++ src/commonfunctions.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Readme.txt b/src/Readme.txt index 8da9eb82..51faea4e 100644 --- a/src/Readme.txt +++ b/src/Readme.txt @@ -86,6 +86,10 @@ https://www.billmate.se/press-och-media/ == Changelog == += 3.6.2 (2019-11-20) +* Feature - Selected payment method in Billmate Checkout is shown in WooCommerce order details +* Fix - Additional rules for checkout url to not be overwritten by billmatecheckout url + = 3.6.0 (2019-11-13) * Feature - Selected payment method in Billmate Checkout is shown in WooCommerce order details * Fix - Aditional rules for checkout url to not be overwritten by billmatecheckout url diff --git a/src/commonfunctions.php b/src/commonfunctions.php index a276c58d..845359f3 100644 --- a/src/commonfunctions.php +++ b/src/commonfunctions.php @@ -1,5 +1,5 @@