Compare commits

...

3 Commits

Author SHA1 Message Date
Bastian de Byl
b93afeec2f added Created and Modified times to SnipcartOrder 2023-04-09 18:31:53 -04:00
Bastian de Byl
bc56b4d16a 8677r5eju added initial .drone.yml 2023-04-06 23:34:18 -04:00
Bastian de Byl
b08b64f5b2 added SnipcartTax and SnipcartWebhookTaxResponse 2023-04-06 17:59:48 -04:00
2 changed files with 14 additions and 0 deletions

View File

@@ -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"`
@@ -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,

View File

@@ -15,3 +15,7 @@ type SnipcartShippingAddress struct {
Phone string `json:"phone"`
VatNumber string `json:"vatNumber,omitempty"`
}
type SnipcartWebhookTaxResponse struct {
Taxes []SnipcartTax `json:"taxes"`
}