Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7c5fd3b74 | ||
|
|
b586a3184c | ||
|
|
805491571c | ||
|
|
10a9427598 | ||
|
|
3816c67b95 | ||
|
|
c18376739b | ||
|
|
6d85149be8 | ||
|
|
cf4ad9642d | ||
|
|
e1adf8cf4f | ||
|
|
73195a090f | ||
|
|
db81f246bf |
2
go.mod
2
go.mod
@@ -3,7 +3,7 @@ module github.com/debyltech/go-snipcart
|
|||||||
go 1.19
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/debyltech/go-helpers v1.1.0
|
github.com/debyltech/go-helpers v1.1.1
|
||||||
github.com/debyltech/go-shippr v0.1.0
|
github.com/debyltech/go-shippr v0.1.0
|
||||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -39,4 +39,7 @@ type Client struct {
|
|||||||
type CustomField struct {
|
type CustomField struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Value string `json:"value"`
|
Value string `json:"value"`
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
Options string `json:"options,omitempty"`
|
||||||
|
Required bool `json:"required"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,14 +26,24 @@ type Item struct {
|
|||||||
Shippable bool `json:"shippable,omitempty"`
|
Shippable bool `json:"shippable,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type OrderTax struct {
|
||||||
|
Name string `json:"taxName"`
|
||||||
|
Rate float64 `json:"taxRate"`
|
||||||
|
Amount float64 `json:"amount"`
|
||||||
|
NumberForInvoice string `json:"numberForInvoice"`
|
||||||
|
}
|
||||||
|
|
||||||
type Order struct {
|
type Order struct {
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
Created time.Time `json:"creationDate"`
|
Created time.Time `json:"creationDate"`
|
||||||
Modified time.Time `json:"modificationDate"`
|
Modified time.Time `json:"modificationDate"`
|
||||||
|
Completed time.Time `json:"completionDate"`
|
||||||
Invoice string `json:"invoiceNumber"`
|
Invoice string `json:"invoiceNumber"`
|
||||||
Subtotal float64 `json:"subtotal,omitempty"`
|
Subtotal float64 `json:"subtotal,omitempty"`
|
||||||
Currency string `json:"currency,omitempty"`
|
Currency string `json:"currency,omitempty"`
|
||||||
Total float64 `json:"grandTotal,omitempty"`
|
Total float64 `json:"grandTotal,omitempty"`
|
||||||
|
TotalTaxable float64 `json:"taxableTotal,omitempty"`
|
||||||
|
TotalTaxes float64 `json:"taxesTotal,omitempty"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
TotalWeight float64 `json:"totalWeight"`
|
TotalWeight float64 `json:"totalWeight"`
|
||||||
ShippingAddress Address `json:"shippingAddress,omitempty"`
|
ShippingAddress Address `json:"shippingAddress,omitempty"`
|
||||||
@@ -54,6 +64,7 @@ type Order struct {
|
|||||||
ShippingMethod string `json:"shippingMethod,omitempty"`
|
ShippingMethod string `json:"shippingMethod,omitempty"`
|
||||||
ShippingRateId string `json:"shippingRateUserDefinedId,omitempty"`
|
ShippingRateId string `json:"shippingRateUserDefinedId,omitempty"`
|
||||||
Items []Item `json:"items"`
|
Items []Item `json:"items"`
|
||||||
|
Taxes []OrderTax `json:"taxes,omitempty"`
|
||||||
Metadata any `json:"metadata"`
|
Metadata any `json:"metadata"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,6 +79,8 @@ type OrderUpdate struct {
|
|||||||
|
|
||||||
type Orders struct {
|
type Orders struct {
|
||||||
TotalItems int
|
TotalItems int
|
||||||
|
Offest int
|
||||||
|
Limit int
|
||||||
Items []Order
|
Items []Order
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,17 +4,25 @@ import (
|
|||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type ShippingError struct {
|
||||||
|
Key string `json:"key"`
|
||||||
|
Message string `json:"message"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ShippingErrors struct {
|
||||||
|
Errors []ShippingError `json:"errors"`
|
||||||
|
}
|
||||||
|
|
||||||
type TaxShippingInfo struct {
|
type TaxShippingInfo struct {
|
||||||
Fees float64 `json:"fees"`
|
Fees float64 `json:"fees"`
|
||||||
Method string `json:"method"`
|
Method string `json:"method"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TaxContent struct {
|
type TaxContent struct {
|
||||||
Created time.Time `json:"creationDate"`
|
Created int `json:"creationDate"`
|
||||||
Modified time.Time `json:"modificationDate"`
|
Modified int `json:"modificationDate"`
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
ShipToBillingAddress bool `json:"shipToBillingAddress"`
|
ShipToBillingAddress bool `json:"shipToBillingAddress"`
|
||||||
|
|||||||
Reference in New Issue
Block a user