From 89338bc97071f4266afed4fe15d6f7a6e47595e6 Mon Sep 17 00:00:00 2001 From: Mattias Nilsson Date: Fri, 1 May 2020 17:38:33 +0200 Subject: [PATCH] Revert "Merge pull request #447 from Billmate/WPM-139" This reverts commit c78b14417d4927e65afc62640988866763abfbc8, reversing changes made to d2cf4fedb0986717744d25cd670b1823e5fbc9f7. --- src/gateway-billmate.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/gateway-billmate.php b/src/gateway-billmate.php index 318ec201..c4c1a742 100755 --- a/src/gateway-billmate.php +++ b/src/gateway-billmate.php @@ -1164,26 +1164,21 @@ public function common_check_ipn_response($config = array()) { $updatePaymentData['PaymentData'] = array( "number" => $data['number'], ); - $addedSkus = array(); foreach ($order->get_items() as $item_id => $item_data) { $tax = new WC_Tax(); - $product = $this->order->get_product_from_item( $item ); - $billmateProduct = new BillmateProduct($product, [$item_id => $item_data]); - if (in_array($billmateProduct->getSku(), $addedSkus)){ - continue; - } + $product = $item_data->get_product(); $product_tax_class = $product->get_tax_class(); $product_tax = $tax->get_rates($product_tax_class); $rate = array_pop($product_tax); $rate = $rate['rate']; $updatePaymentData["Articles"][] = array( - "artnr" => $billmateProduct->getSku(), + "artnr" => $product->get_sku(), "title" => $item_data->get_name(), "quantity" => $item_data->get_quantity(), - "aprice" => round(($item_data->get_total() / $item_data->get_quantity()) * 100, 0), + "aprice" => ($item_data->get_total() / $item_data->get_quantity()) * 100, "taxrate" => $rate, "discount" => "0", - "withouttax" => round($item_data->get_total() * 100, 0), + "withouttax" => $item_data->get_total() * 100, ); } $order->calculate_totals(true);