Posted on 21/05/2014 15:53:40
Hi Imar,
I can understand the confusion. Basically, the only methods, you should consider overriding are AddTaxToProducts, AddTaxToOrder, CommitTaxes and CancelTaxes. For inspiration, you can look at our built-in tax providers. You can find the source code here: http://developer.dynamicweb-cms.com/downloads/source-code.aspx.
CommitTaxes and CancelTaxes are mostly used if you need to commit a transaction or finalize something upon order completion. CommitTaxes is called when the checkout is done and successful, and CancelTaxes is called when the order is deleted from the backend.
AddTaxToProducts is called from the product catalog and gives you the option of adding taxes to the products being displayed in the frontend. Basically, you add a Tax object to the TaxCollection of the relevant products, and that propergates through to the frontend.
AddTaxToOrder is a way to add tax orderline to the order object. You can use the helper method CreateTaxOrderLine, available as a protected method on the TaxProvider base class, to create an orderline. Simply pass in the parent orderline that triggered the tax and the Tax object itself, and you'll get an OrderLine back that you can add to the order's OrderLines collection.
If you need to log something, you can use the protected method on the TaxProvider base class, called SaveLog.
I hope this helps you progress :)
- Jeppe