forked from bcmi-labs/taxjar-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.go
79 lines (71 loc) · 4.63 KB
/
common.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package taxjar
type Address struct {
Street string `json:"street,omitempty" bson:"street,omitempty"`
City string `json:"city,omitempty" bson:"city,omitempty"`
State string `json:"state,omitempty" bson:"state,omitempty"`
Zip string `json:"zip,omitempty" bson:"zip,omitempty"`
Country string `json:"country,omitempty" bson:"country,omitempty"`
}
type LineItem struct {
ID string `json:"id,omitempty" bson:"id,omitempty"`
Quantity int64 `json:"quantity,omitempty" bson:"quantity,omitempty"`
ProductTaxCode string `json:"product_tax_code,omitempty" bson:"product_tax_code,omitempty"`
ProductIdentifier string `json:"product_identifier,omitempty" bson:"product_identifier,omitempty"`
Description string `json:"description,omitempty" bson:"description,omitempty"`
UnitPrice float64 `json:"unit_price,omitempty" bson:"unit_price,omitempty"`
Discount float64 `json:"discount,omitempty" bson:"discount,omitempty"`
SalesTax float64 `json:"sales_tax,omitempty" bson:"sales_tax,omitempty"`
}
type Shipping struct {
StateTaxableAmount float64 `json:"state_taxable_amount" bson:"state_taxable_amount"`
StateSalesTaxRate float64 `json:"state_sales_tax_rate" bson:"state_sales_tax_rate"`
StateAmount float64 `json:"state_amount" bson:"state_amount"`
CountyTaxableAmount float64 `json:"county_taxable_amount" bson:"county_taxable_amount"`
CountyTaxRate float64 `json:"county_tax_rate" bson:"county_tax_rate"`
CountyAmount float64 `json:"county_amount" bson:"county_amount"`
CityTaxableAmount float64 `json:"city_taxable_amount" bson:"city_taxable_amount"`
CityTaxRate float64 `json:"city_tax_rate" bson:"city_tax_rate"`
CityAmount float64 `json:"city_amount" bson:"city_amount"`
SpecialTaxableAmount float64 `json:"special_district_taxable_amount" bson:"special_district_taxable_amount"`
SpecialTaxRate float64 `json:"special_tax_rate" bson:"special_tax_rate"`
SpecialAmount float64 `json:"special_district_amount" bson:"special_district_amount"`
// For CA transactions
GstTaxableAmount float64 `json:"gst_taxable_amount" bson:"gst_taxable_amount"`
GstTaxRate float64 `json:"gst_tax_rate" bson:"gst_tax_rate"`
GstAmount float64 `json:"gst" bson:"gst"`
PstTaxableAmount float64 `json:"pst_taxable_amount" bson:"pst_taxable_amount"`
PstTaxRate float64 `json:"pst_tax_rate" bson:"pst_tax_rate"`
PstAmount float64 `json:"pst" bson:"pst"`
QstTaxableAmount float64 `json:"qst_taxable_amount" bson:"qst_taxable_amount"`
QstTaxRate float64 `json:"qst_tax_rate" bson:"qst_tax_rate"`
QstAmount float64 `json:"qst" bson:"qst"`
}
type Breakdown struct {
Shipping Shipping `json:"shipping" bson:"shipping"`
LineItems []TaxLineItem `json:"line_items" bson:"line_items"`
TaxCollectable float64 `json:"tax_collectable" bson:"tax_collectable"`
TaxableAmount float64 `json:"taxable_amount" bson:"taxable_amount"`
// For US transactions
StateTaxableAmount float64 `json:"state_taxable_amount" bson:"state_taxable_amount"`
StateTaxRate float64 `json:"state_tax_rate" bson:"state_tax_rate"`
StateTaxCollectable float64 `json:"state_tax_collectable" bson:"state_tax_collectable"`
CountyTaxableAmount float64 `json:"county_taxable_amount" bson:"county_taxable_amount"`
CountyTaxRate float64 `json:"county_tax_rate" bson:"county_tax_rate"`
CountyTaxCollectable float64 `json:"county_tax_collectable" bson:"county_tax_collectable"`
CityTaxableAmount float64 `json:"city_taxable_amount" bson:"city_taxable_amount"`
CityTaxRate float64 `json:"city_tax_rate" bson:"city_tax_rate"`
CityTaxCollectable float64 `json:"city_tax_collectable" bson:"city_tax_collectable"`
SpecialTaxableAmount float64 `json:"special_district_taxable_amount" bson:"special_district_taxable_amount"`
SpecialTaxRate float64 `json:"special_tax_rate" bson:"special_tax_rate"`
SpecialTaxCollectable float64 `json:"special_district_tax_collectable" bson:"special_district_tax_collectable"`
// For CA transactions
GstTaxableAmount float64 `json:"gst_taxable_amount" bson:"gst_taxable_amount"`
GstTaxCollectable float64 `json:"gst" bson:"gst"`
GstTaxRate float64 `json:"gst_tax_rate" bson:"gst_tax_rate"`
PstTaxableAmount float64 `json:"pst_taxable_amount" bson:"pst_taxable_amount"`
PstTaxCollectable float64 `json:"pst" bson:"pst"`
PstTaxRate float64 `json:"pst_tax_rate" bson:"pst_tax_rate"`
QstTaxableAmount float64 `json:"qst_taxable_amount" bson:"qst_taxable_amount"`
QstTaxCollectable float64 `json:"qst" bson:"qst"`
QstTaxRate float64 `json:"qst_tax_rate" bson:"qst_tax_rate"`
}