From bfd1d3bc0c9ddba54eeea3d6b805b1d15e98ab99 Mon Sep 17 00:00:00 2001 From: Fatih Toprak Date: Thu, 23 Dec 2021 14:42:01 +0300 Subject: [PATCH] 2.5/cart-tax-calculate --- core/library/Moka_Gateway.php | 6 +++--- readme.md | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/library/Moka_Gateway.php b/core/library/Moka_Gateway.php index 862234d..250f41c 100644 --- a/core/library/Moka_Gateway.php +++ b/core/library/Moka_Gateway.php @@ -350,7 +350,7 @@ public function validate_fields() public function process_payment( $orderId ) { $order = new WC_order($orderId); - $orderDetails = self::formatOrder($orderId); + $orderDetails = self::formatOrder($orderId); $currentTotal = data_get($orderDetails, 'Amount'); $installmentNumber = data_get($orderDetails, 'InstallmentNumber'); $currency = $order->get_currency(); @@ -551,7 +551,7 @@ private function formatOrder( $orderId ) $selectedInstallment = data_get($postData, $this->id.'-installment'); $currentComission = data_get($rates, $selectedInstallment.'.value'); - + $orderData = [ 'CardHolderFullName' => (string) data_get($postData, $this->id.'-name-oncard'), 'CardNumber' => (string) self::formatCartNumber(data_get($postData, $this->id.'-card-number')), @@ -650,7 +650,7 @@ private function formatExperyDate($string) */ private function calculateComissionRate( $total, $percent ) { - $total = ( ( ((int)$total*(int)$percent)/100) + (int)$total); + $total = ( ( ($total*$percent)/100) + $total); return number_format($total,2,'.', ''); } diff --git a/readme.md b/readme.md index a239b38..ce8049d 100644 --- a/readme.md +++ b/readme.md @@ -35,6 +35,7 @@ Moka Pos, Moka Pay plugin; #### Version 2.5 - Issue : Card Expiry Date validation issue fixed. +- Issue : Cart Total tax rates calculating issue. #### Version 2.4 - Feature : Added Order Prefix for multiple domain usage.