Compare commits

...

1 Commits

Author SHA1 Message Date
Bastian de Byl
5a74c2bae8 main corrected Operation in ProductCustomField to float64 from int 2023-05-12 15:23:14 -04:00
2 changed files with 1 additions and 33 deletions

View File

@@ -1,32 +0,0 @@
package main
import (
"flag"
"log"
"github.com/debyltech/go-snipcart/snipcart"
)
func main() {
snipcartApiKey := flag.String("key", "", "Snipcart API Key")
flag.Parse()
if *snipcartApiKey == "" {
log.Fatal("missing -key flag")
}
Client := snipcart.NewClient(*snipcartApiKey)
updateOrder := snipcart.SnipcartOrderUpdate{
Status: snipcart.Delivered,
}
response, err := Client.UpdateOrder("b35990df-c0ca-4014-94de-1caa7bd7bb51", &updateOrder)
if err != nil {
log.Fatal(err)
}
for k, v := range response.Items {
log.Printf("%v: %v\n", k, v)
}
}

View File

@@ -135,7 +135,7 @@ type SnipcartProductCustomField struct {
Options string `json:"options"`
Required bool `json:"required"`
Value string `json:"value"`
Operation int `json:"operation"`
Operation float64 `json:"operation"`
OptionsArray []string `json:"optionsArray"`
}