Helper/Order.php
private function adjustTaxMismatch($transaction, $order, $quote)
    {
        $boltTaxAmount = round($transaction->order->cart->tax_amount->amount / 100, 2);
        $boltTotalAmount = round($transaction->order->cart->total_amount->amount / 100, 2);

        $orderTaxAmount = round($order->getTaxAmount(), 2);

        if ($boltTaxAmount != $orderTaxAmount) {

            $order->setTaxAmount($boltTaxAmount);
            $order->setBaseGrandTotal($boltTotalAmount);
            $order->setGrandTotal($boltTotalAmount);

            $this->bugsnag->registerCallback(function ($report) use ($quote, $boltTaxAmount, $orderTaxAmount) {

                $address = $quote->isVirtual() ? $quote->getBillingAddress() : $quote->getShippingAddress();

                $report->setMetaData([
                    'TAX MISMATCH' => [
                        'Store Applied Taxes' => $address->getAppliedTaxes(),
                        'Bolt Tax Amount' => $boltTaxAmount,
                        'Store Tax Amount' => $orderTaxAmount,
                        'Order #' => $quote->getReservedOrderId(),
                        'Quote ID' => $quote->getId(),

                    ]
                ]);
            });

            $diff = round($boltTaxAmount - $orderTaxAmount, 2);
            $this->bugsnag->notifyError('Tax Mismatch', "Totals adjusted by $diff");
        }
    }
private function adjustTaxMismatch($transaction, $order, $quote)
    {
        $boltTaxAmount = round($transaction->order->cart->tax_amount->amount / 100, 2);
        $boltTotalAmount = round($transaction->order->cart->total_amount->amount / 100, 2);

        $orderTaxAmount = round($order->getTaxAmount(), 2);

        if ($boltTaxAmount != $orderTaxAmount) {

            $order->setTaxAmount($boltTaxAmount);
            $order->setBaseGrandTotal($boltTotalAmount);
            $order->setGrandTotal($boltTotalAmount);

            $this->bugsnag->registerCallback(function ($report) use ($quote, $boltTaxAmount, $orderTaxAmount) {

                $address = $quote->isVirtual() ? $quote->getBillingAddress() : $quote->getShippingAddress();

                $report->setMetaData([
                    'TAX MISMATCH' => [
                        'Store Applied Taxes' => $address->getAppliedTaxes(),
                        'Bolt Tax Amount' => $boltTaxAmount,
                        'Store Tax Amount' => $orderTaxAmount,
                        'Order #' => $quote->getReservedOrderId(),
                        'Quote ID' => $quote->getId(),

                    ]
                ]);
            });

            $diff = round($boltTaxAmount - $orderTaxAmount, 2);
            $this->bugsnag->notifyError('Tax Mismatch', "Totals adjusted by $diff");
        }
    }
private function adjustTaxMismatch ( $ transaction , $ order , $ quote ) { $ boltTaxAmount = round ( $ transaction -> order -> cart -> tax_amount -> amount / 100 , 2 ) ; $ boltTotalAmount = round ( $ transaction -> order -> cart -> total_amount -> amount / 100 , 2 ) ; $ orderTaxAmount = round ( $ order -> getTaxAmount ( ) , 2 ) ; if ( $ boltTaxAmount != $ orderTaxAmount ) { $ order -> setTaxAmount ( $ boltTaxAmount ) ; $ order -> setBaseGrandTotal ( $ boltTotalAmount ) ; $ order -> setGrandTotal ( $ boltTotalAmount ) ; $ this -> bugsnag -> registerCallback ( function ( $ report ) use ( $ quote , $ boltTaxAmount , $ orderTaxAmount ) { $ address = $ quote -> isVirtual ( ) ? $ quote -> getBillingAddress ( ) : $ quote -> getShippingAddress ( ) ; $ report -> setMetaData ( [ 'TAX MISMATCH' => [ 'Store Applied Taxes' => $ address -> getAppliedTaxes ( ) , 'Bolt Tax Amount' => $ boltTaxAmount , 'Store Tax Amount' => $ orderTaxAmount , 'Order #' => $ quote -> getReservedOrderId ( ) , 'Quote ID' => $ quote -> getId ( ) , ] ] ) ; } ) ; $ diff = round ( $ boltTaxAmount - $ orderTaxAmount , 2 ) ; $ this -> bugsnag -> notifyError ( 'Tax Mismatch' , "Totals adjusted by $diff" ) ; } }
Check for Tax mismatch between Bolt and Magento.
Override store value with the Bolt one if a mismatch was found.

@param \stdClass $transaction
@param OrderModel $order
@param Quote $quote
Check for Tax mismatch between Bolt and Magento . Override store value with the Bolt one if a mismatch was found .