Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b93afeec2f | ||
|
|
bc56b4d16a | ||
|
|
b08b64f5b2 | ||
|
|
ad93704f41 |
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
helper "github.com/debyltech/go-helpers/json"
|
||||
"github.com/skip2/go-qrcode"
|
||||
@@ -48,6 +49,8 @@ type SnipcartItem struct {
|
||||
|
||||
type SnipcartOrder struct {
|
||||
Token string `json:"token"`
|
||||
Created time.Time `json:"creationDate"`
|
||||
Modified time.Time `json:"modificationDate"`
|
||||
Invoice string `json:"invoiceNumber"`
|
||||
Subtotal float64 `json:"subtotal,omitempty"`
|
||||
Currency string `json:"currency,omitempty"`
|
||||
@@ -70,7 +73,7 @@ type SnipcartOrder struct {
|
||||
ShippingCost float64 `json:"shippingFees"`
|
||||
ShippingProvider string `json:"shippingProvider,omitempty"`
|
||||
ShippingMethod string `json:"shippingMethod,omitempty"`
|
||||
ShippingRate string `json:"shippingRateUserDefinedId,omitempty"`
|
||||
ShippingRateId string `json:"shippingRateUserDefinedId,omitempty"`
|
||||
Items []SnipcartItem `json:"items"`
|
||||
Metadata any `json:"metadata"`
|
||||
}
|
||||
@@ -88,6 +91,13 @@ type SnipcartOrders struct {
|
||||
Items []SnipcartOrder
|
||||
}
|
||||
|
||||
type SnipcartTax struct {
|
||||
Name string `json:"name"`
|
||||
Amount float64 `json:"amount"`
|
||||
NumberForInvoice string `json:"numberForInvoice"`
|
||||
Rate float64 `json:"rate"`
|
||||
}
|
||||
|
||||
func NewClient(snipcartApiKey string) Client {
|
||||
return Client{
|
||||
SnipcartKey: snipcartApiKey,
|
||||
|
||||
@@ -15,3 +15,7 @@ type SnipcartShippingAddress struct {
|
||||
Phone string `json:"phone"`
|
||||
VatNumber string `json:"vatNumber,omitempty"`
|
||||
}
|
||||
|
||||
type SnipcartWebhookTaxResponse struct {
|
||||
Taxes []SnipcartTax `json:"taxes"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user