Changeset 2522848
- Timestamp:
- 04/28/2021 04:02:09 PM (5 years ago)
- Location:
- smallpay/trunk
- Files:
-
- 4 edited
-
includes/class-wc-gateway-smallpay-order-payment-info.php (modified) (1 diff)
-
includes/class-wc-gateway-smallpay.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
-
smallpay.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smallpay/trunk/includes/class-wc-gateway-smallpay-order-payment-info.php
r2385656 r2522848 83 83 $aDetailsOrder = json_decode($jDetailsOrder, true); 84 84 85 if ( $aDetailsOrder["codTrans"] == "") {85 if (isset($aDetailsOrder["codTrans"]) && $aDetailsOrder["codTrans"] == "") { 86 86 $aDetailsOrder["codTrans"] = get_post_meta($this->order_id, 'xpay_cod_trans', true); 87 87 } -
smallpay/trunk/includes/class-wc-gateway-smallpay.php
r2514705 r2522848 465 465 $enviroment = $this->oConfig->enviroment; 466 466 $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() ) ); 470 469 471 470 $transactionId = $oXPay->get_cod_trans(date('Ymd')); … … 518 517 $oXPay = new WC_SmallPay_XPay($this->oConfig->url_gateway); 519 518 $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() ) ); 523 521 $instData = $this->calc_installments($installments, true); 524 522 $checkExp = $this->exp_check($installments, sanitize_text_field($_REQUEST['dettaglioCarta']['scadenza']), true); … … 578 576 public function calc_installments($installments = null, $php = false) 579 577 { 580 error_log('***');581 578 $ret = array(); 582 579 if ($installments == null && !empty($_REQUEST['installments'])) { … … 586 583 $totalNF = $woocommerce->cart->total; 587 584 $totalNF = number_format($totalNF, 2,'.',''); 588 error_log('$totalNF :: ' . $totalNF);589 585 $shippingNF = $woocommerce->cart->shipping_total; 590 586 $shippingNF = number_format($shippingNF, 2,'.',''); 591 error_log('$shippingNF :: ' . $shippingNF);592 587 if (isset($installments) && $installments != 0) { 593 588 $installment_amountNF = floor((($totalNF*100)-($shippingNF*100)) / $installments); … … 597 592 $first_installment_amountNF = 0; 598 593 } 599 error_log('$installment_amountNF :: ' . $installment_amountNF);600 error_log('$first_installment_amountNF :: ' . $first_installment_amountNF);601 594 $installment_amount = $installment_amountNF / 100; 602 595 //$installment_amount = number_format($installment_amount, 2, ',', ' '); … … 604 597 //$first_installment_amount = number_format($first_installment_amount, 2, ',', ' '); 605 598 //$total = number_format($totalNF, 2, ',', ' '); 606 error_log('$installment_amount :: ' . $installment_amount);607 error_log('$first_installment_amount :: ' . $first_installment_amount);608 error_log('---');609 599 $oXPay = new WC_SmallPay_XPay(); 610 600 $transactionId = $oXPay->get_cod_trans(date('Ymd')); -
smallpay/trunk/readme.txt
r2514705 r2522848 8 8 WC Requires at least: 3.0.0 9 9 WC Tested up to: 5.2.0 10 Stable tag: 3.0. 710 Stable tag: 3.0.8 11 11 License: GNU General Public License v3.0 12 12 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 107 107 = 3.0.7 = 108 108 * Fixed - issue with wordpress installed in subfolders 109 110 = 3.0.8 = 111 * Fixed - payment issue -
smallpay/trunk/smallpay.php
r2514705 r2522848 5 5 * Plugin URI: 6 6 * Description: Official SmallPay plugin. 7 * Version: 3.0. 77 * Version: 3.0.8 8 8 * Author: SmallPay Srl 9 9 * Author URI: https://www.smallpay.it … … 23 23 } 24 24 25 define('SPWC_PLUGIN_VERSION', '3.0. 7');25 define('SPWC_PLUGIN_VERSION', '3.0.8'); 26 26 27 27 class WC_SmallPay
Note: See TracChangeset
for help on using the changeset viewer.