Plugin Directory

Changeset 2522848


Ignore:
Timestamp:
04/28/2021 04:02:09 PM (5 years ago)
Author:
iplus
Message:

v 3.0.8

Location:
smallpay/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • smallpay/trunk/includes/class-wc-gateway-smallpay-order-payment-info.php

    r2385656 r2522848  
    8383        $aDetailsOrder = json_decode($jDetailsOrder, true);
    8484
    85         if ($aDetailsOrder["codTrans"] == "") {
     85        if (isset($aDetailsOrder["codTrans"]) && $aDetailsOrder["codTrans"] == "") {
    8686            $aDetailsOrder["codTrans"] = get_post_meta($this->order_id, 'xpay_cod_trans', true);
    8787        }
  • smallpay/trunk/includes/class-wc-gateway-smallpay.php

    r2514705 r2522848  
    465465        $enviroment = $this->oConfig->enviroment;
    466466        $APIKEY = $this->oConfig->nexi_alias;
    467         $amount = preg_replace('#[^\d,]#', '', strip_tags($woocommerce->cart->get_total()));
    468         $amount = number_format($amount,2,',', '');
    469         $amount = $amount * 100;
     467        $amount = preg_replace('#[^\d,.]#', '', strip_tags($woocommerce->cart->get_total()));
     468        $amount = absint( wc_format_decimal( ( (float) $amount * 100 ), wc_get_price_decimals() ) );
    470469
    471470        $transactionId = $oXPay->get_cod_trans(date('Ymd'));
     
    518517        $oXPay = new WC_SmallPay_XPay($this->oConfig->url_gateway);
    519518        $installments = sanitize_text_field($_REQUEST['installments']);
    520         $amount = preg_replace('#[^\d,]#', '', strip_tags($order->get_total()));
    521         $amount = number_format($amount,2,',', '');
    522         $amount = $amount * 100;
     519        $amount = preg_replace('#[^\d,.]#', '', strip_tags($order->get_total()));
     520        $amount = absint( wc_format_decimal( ( (float) $amount * 100 ), wc_get_price_decimals() ) );
    523521        $instData = $this->calc_installments($installments, true);
    524522        $checkExp = $this->exp_check($installments, sanitize_text_field($_REQUEST['dettaglioCarta']['scadenza']), true);
     
    578576    public function calc_installments($installments = null, $php = false)
    579577    {
    580         error_log('***');
    581578        $ret = array();
    582579        if ($installments == null && !empty($_REQUEST['installments'])) {
     
    586583        $totalNF = $woocommerce->cart->total;
    587584        $totalNF = number_format($totalNF, 2,'.','');
    588         error_log('$totalNF :: ' . $totalNF);
    589585        $shippingNF = $woocommerce->cart->shipping_total;
    590586        $shippingNF = number_format($shippingNF, 2,'.','');
    591         error_log('$shippingNF :: ' . $shippingNF);
    592587        if (isset($installments) && $installments != 0) {
    593588            $installment_amountNF = floor((($totalNF*100)-($shippingNF*100)) / $installments);
     
    597592            $first_installment_amountNF = 0;
    598593        }
    599         error_log('$installment_amountNF :: ' . $installment_amountNF);
    600         error_log('$first_installment_amountNF :: ' . $first_installment_amountNF);
    601594        $installment_amount = $installment_amountNF / 100;
    602595        //$installment_amount = number_format($installment_amount, 2, ',', ' ');
     
    604597        //$first_installment_amount = number_format($first_installment_amount, 2, ',', ' ');
    605598        //$total = number_format($totalNF, 2, ',', ' ');
    606         error_log('$installment_amount :: ' . $installment_amount);
    607         error_log('$first_installment_amount :: ' . $first_installment_amount);
    608         error_log('---');
    609599        $oXPay = new WC_SmallPay_XPay();
    610600        $transactionId = $oXPay->get_cod_trans(date('Ymd'));
  • smallpay/trunk/readme.txt

    r2514705 r2522848  
    88WC Requires at least: 3.0.0
    99WC Tested up to: 5.2.0
    10 Stable tag: 3.0.7
     10Stable tag: 3.0.8
    1111License: GNU General Public License v3.0
    1212License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    107107= 3.0.7 =
    108108 * Fixed - issue with wordpress installed in subfolders
     109 
     110= 3.0.8 =
     111 * Fixed - payment issue
  • smallpay/trunk/smallpay.php

    r2514705 r2522848  
    55 * Plugin URI:
    66 * Description: Official SmallPay plugin.
    7  * Version: 3.0.7
     7 * Version: 3.0.8
    88 * Author: SmallPay Srl
    99 * Author URI: https://www.smallpay.it
     
    2323}
    2424
    25 define('SPWC_PLUGIN_VERSION', '3.0.7');
     25define('SPWC_PLUGIN_VERSION', '3.0.8');
    2626
    2727class WC_SmallPay
Note: See TracChangeset for help on using the changeset viewer.