Documentation ¶
Overview ¶
Package tax is a implementation of tax interface declared in "github.com/ottemo/commerce/app/models/checkout" package
Index ¶
Constants ¶
View Source
const ( ConstErrorModule = "tax" ConstErrorLevel = env.ConstErrorLevelActor ConstPriorityValue = 2.50 ConstProductTaxableAttribute = "taxable" )
Package global constants
Variables ¶
This section is empty.
Functions ¶
func APIDownloadTaxCSV ¶
func APIDownloadTaxCSV(context api.InterfaceApplicationContext) (interface{}, error)
APIDownloadTaxCSV returns csv file with currently used tax rates
- returns not a JSON, but csv file
func APIUploadTaxCSV ¶
func APIUploadTaxCSV(context api.InterfaceApplicationContext) (interface{}, error)
APIUploadTaxCSV replaces currently used discount coupons with data from provided in csv file
- csv file should be provided in "file" field
Types ¶
type DefaultTax ¶
type DefaultTax struct{}
DefaultTax is a default implementer of InterfaceTax
func (*DefaultTax) Calculate ¶
func (it *DefaultTax) Calculate(currentCheckout checkout.InterfaceCheckout, currentPriority float64) []checkout.StructPriceAdjustment
Calculate calculates a taxes for a given checkout
func (*DefaultTax) GetCode ¶
func (it *DefaultTax) GetCode() string
GetCode returns code of current tax implementation
func (*DefaultTax) GetName ¶
func (it *DefaultTax) GetName() string
GetName returns name of current tax implementation
func (*DefaultTax) GetPriority ¶
func (it *DefaultTax) GetPriority() []float64
GetPriority returns the code of the current coupon implementation
Click to show internal directories.
Click to hide internal directories.