servicewoo

package
v5.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BillingAddress

type BillingAddress struct {
	ShippingAddress
	Email string `json:"email"`
	Phone string `json:"phone"`
}

type Category

type Category struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type Coupon

type Coupon struct {
	ID     int    `json:"id,omitempty"`
	Code   string `json:"code,omitempty"`
	Amount string `json:"amount"`
}

Coupon : "discount_type", "date_expires", "individual_use",... | currently assume that only one type is used and no expires TODO: add logic to differentiate types

type FeeLine

type FeeLine struct {
	ID        int        `json:"id"`
	Name      string     `json:"name"`
	TaxClass  string     `json:"tax_class"`
	TaxStatus string     `json:"tax_status"`
	Amount    string     `json:"amount"`
	Total     string     `json:"total"`
	TotalTax  string     `json:"total_tax"`
	MetaData  []MetaData `json:"meta_data"`
}

type Image

type Image struct {
	Source string `json:"src"`
}

type LineItem

type LineItem struct {
	ID          int               `json:"id"`
	Name        string            `json:"name"`
	ProductID   int               `json:"product_id"`
	VariationID *int              `json:"variation_id"`
	Quantity    int               `json:"quantity"`
	TaxClass    string            `json:"tax_class"`
	SubTotal    string            `json:"subtotal"`
	SubTotalTax string            `json:"subtotal_tax"`
	Total       string            `json:"total"`
	TotalTax    string            `json:"total_tax"`
	Taxes       []Tax             `json:"taxes"`
	MetaData    []MetaData        `json:"meta_data"`
	SKU         string            `json:"sku"`
	Price       float32           `json:"price"`
	Categories  []ProductCategory `json:"_al_categories"`
}

type MetaData

type MetaData struct {
	Key          string      `json:"key"`
	Value        interface{} `json:"value"`
	DisplayKey   string      `json:"display_key"`
	DisplayValue string      `json:"display_value"`
}

type Order

type Order struct {
	ID               int             `json:"id"`
	Number           string          `json:"number"`
	DiscountTotal    string          `json:"discount_total"`
	DiscountTax      string          `json:"discount_tax"`
	ShippingTotal    string          `json:"shipping_total"`
	ShippingTax      string          `json:"shipping_tax"`
	CartTax          string          `json:"cart_tax"`
	Total            string          `json:"total"`
	TotalTax         string          `json:"total_tax"`
	PricesIncludeTax bool            `json:"prices_include_tax"`
	CustomerNote     string          `json:"customer_note"`
	Billing          BillingAddress  `json:"billing"`
	Shipping         ShippingAddress `json:"shipping"`
	MetaData         []MetaData      `json:"meta_data"`
	LineItems        []LineItem      `json:"line_items"`
	TaxLines         []TaxLine       `json:"tax_lines"`
	ShippingLines    []ShippingLine  `json:"shipping_lines"`
	FeeLines         []FeeLine       `json:"fee_lines"`
	Refunds          []OrderRefund   `json:"refunds"`
	DateCreatedGMT   string          `json:"date_created_gmt"`
}

func (*Order) GetDateCreated

func (o *Order) GetDateCreated() (time.Time, error)

func (*Order) GetDeliveryDate

func (o *Order) GetDeliveryDate() string

func (*Order) GetDeliveryTime

func (o *Order) GetDeliveryTime() string

func (*Order) GetInvoiceNumber

func (o *Order) GetInvoiceNumber() string

func (*Order) GetShippingMethod

func (o *Order) GetShippingMethod() string

func (*Order) GetStoreKey

func (o *Order) GetStoreKey() string

func (*Order) GetTip

func (o *Order) GetTip() string

type OrderRefund

type OrderRefund struct {
	ID     int    `json:"id"`
	Reason string `json:"reason"`
	Total  string `json:"total"`
}

type Product

type Product struct {
	ID           int                `json:"id"`
	Name         string             `json:"name"`
	Type         string             `json:"type"`
	Status       string             `json:"status"`
	SKU          string             `json:"sku"`
	Price        string             `json:"price"`
	RegularPrice string             `json:"regular_price"`
	SalePrice    string             `json:"sale_price"`
	TaxClass     string             `json:"tax_class"`
	Categories   []Category         `json:"categories"`
	Images       []Image            `json:"images"`
	Attributes   []ProductAttribute `json:"attributes"`
	Variations   []int              `json:"variations"`
}

type ProductAttribute

type ProductAttribute struct {
	ID        int      `json:"id"`
	Name      string   `json:"name"`
	Position  int      `json:"position"`
	Variation bool     `json:"variation"`
	Visible   bool     `json:"visible"`
	Options   []string `json:"options"`
}

type ProductCategory

type ProductCategory struct {
	TermID         int    `json:"term_id"`
	Name           string `json:"name"`
	TermTaxonomyID int    `json:"term_taxonomy_id"`
	Taxonomy       string `json:"taxonomy"`
	Description    string `json:"description"`
}

type ProductVariation

type ProductVariation struct {
	ID           int                         `json:"id"`
	Price        string                      `json:"price"`
	RegularPrice string                      `json:"regular_price"`
	SalePrice    string                      `json:"sale_price"`
	Attributes   []ProductVariationAttribute `json:"attributes"`
}

type ProductVariationAttribute

type ProductVariationAttribute struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Option string `json:"option"`
}

type Refund

type Refund struct {
	ID             int        `json:"id"`
	DateCreated    string     `json:"date_created"`
	DateCreatedGMT string     `json:"date_created_gmt"`
	Amount         string     `json:"amount"`
	Reason         string     `json:"reason"`
	MetaData       []MetaData `json:"meta_data"`
	LineItems      []LineItem `json:"line_items"`
	TaxLines       []TaxLine  `json:"tax_lines"`
	FeeLines       []FeeLine  `json:"fee_lines"`
}

func (*Refund) GetDateCreated

func (re *Refund) GetDateCreated() (time.Time, error)

type ShippingAddress

type ShippingAddress struct {
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Address1  string `json:"address_1"`
	Address2  string `json:"address_2"`
	City      string `json:"city"`
	State     string `json:"state"`
	Postcode  string `json:"postcode"`
	Country   string `json:"country"`
}

type ShippingLine

type ShippingLine struct {
	ID          int        `json:"id"`
	MethodTitle string     `json:"method_title"`
	MethodID    string     `json:"method_id"`
	Total       string     `json:"total"`
	TotalTax    string     `json:"total_tax"`
	Taxes       []Tax      `json:"taxes"`
	MetaData    []MetaData `json:"meta_data"`
}

type Tax

type Tax struct {
	ID       int    `json:"id"`
	Total    string `json:"total"`
	SubTotal string `json:"subtotal"`
}

type TaxLine

type TaxLine struct {
	ID               int        `json:"id"`
	RateCode         string     `json:"rate_code"`
	RateID           int        `json:"rate_id"`
	Label            string     `json:"label"`
	Compound         bool       `json:"compound"`
	TaxTotal         string     `json:"tax_total"`
	ShippingTaxTotal string     `json:"shipping_tax_total"`
	RatePercent      int        `json:"rate_percent"`
	MetaData         []MetaData `json:"meta_data"`
}

type Woo

type Woo struct {
	URL    string
	Key    string
	Secret string
}

func NewWoo

func NewWoo(ctx context.Context) (*Woo, error)

func (*Woo) NewURL

func (w *Woo) NewURL(ctx context.Context, url string) string

func (*Woo) NewURLAsiaLoop

func (w *Woo) NewURLAsiaLoop(ctx context.Context, url string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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