I’m creating an AvaTax Tax Calculator extension for Expresso Store utilizing the ‘store_order_taxes’ hook.
After getting a response from the API, I'm modifying the value of the tax rate as follows:
$order->tax_name = $tax_response_object->TaxLines->TaxDetails->TaxName; $order->tax_rate = $tax_response_object->TaxLines->Rate; $order->order_tax = $order->order_total * $order->tax_rate; $order->order_total = $order->order_total + $order->order_tax;
Is this the correct way to modify these properties? It seems to be working but, to be honest, it seems too easy. It's the first time I've written an Expresso extension (and my first Expresso store) so I'm a bit cautious.
Any help/guidance would be much apprecaited.