tax

package
v1.4.5-alpha1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2019 License: MPL-2.0 Imports: 7 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL