update again. with more logs
Some checks failed
Build and Publish / Metadata (push) Successful in 11s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 50s
Build and Publish / BuildAndDeployArm64 (push) Has been cancelled

This commit is contained in:
matst80
2025-11-11 16:57:45 +01:00
parent 5223fef2fa
commit 3f9c790dc2
2 changed files with 5 additions and 4 deletions

View File

@@ -44,8 +44,8 @@ func (a *App) HandleCheckoutRequests(amqpUrl string, mux *http.ServeMux, invento
orderHandler := NewAmqpOrderHandler(conn) orderHandler := NewAmqpOrderHandler(conn)
orderHandler.DefineTopics() orderHandler.DefineTopics()
mux.HandleFunc("POST /push", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("/push", func(w http.ResponseWriter, r *http.Request) {
log.Printf("Klarna order confirmation push, method: %s", r.Method)
if r.Method != http.MethodPost { if r.Method != http.MethodPost {
w.WriteHeader(http.StatusMethodNotAllowed) w.WriteHeader(http.StatusMethodNotAllowed)
return return
@@ -128,9 +128,10 @@ func (a *App) HandleCheckoutRequests(amqpUrl string, mux *http.ServeMux, invento
if err != nil { if err != nil {
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
} }
log.Printf("Klarna order validation: %s", order.ID) log.Printf("Klarna order validation: %s, cart id: %s", order.ID, order.MerchantReference1)
cartId, ok := cart.ParseCartId(order.MerchantReference1) cartId, ok := cart.ParseCartId(order.MerchantReference1)
if !ok { if !ok {
log.Printf("Invalid cart id in order reference: %s", order.MerchantReference1)
w.WriteHeader(http.StatusBadRequest) w.WriteHeader(http.StatusBadRequest)
return return
} }

2
go.mod
View File

@@ -3,6 +3,7 @@ module git.tornberg.me/go-cart-actor
go 1.25.3 go 1.25.3
require ( require (
git.tornberg.me/mats/go-redis-inventory v0.0.0-20251110193851-19d7ad0de6e5
github.com/gogo/protobuf v1.3.2 github.com/gogo/protobuf v1.3.2
github.com/google/uuid v1.6.0 github.com/google/uuid v1.6.0
github.com/matst80/slask-finder v0.0.0-20251023104024-f788e5a51d68 github.com/matst80/slask-finder v0.0.0-20251023104024-f788e5a51d68
@@ -29,7 +30,6 @@ require (
) )
require ( require (
git.tornberg.me/mats/go-redis-inventory v0.0.0-20251110193851-19d7ad0de6e5 // indirect
github.com/RoaringBitmap/roaring/v2 v2.13.0 // indirect github.com/RoaringBitmap/roaring/v2 v2.13.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.24.1 // indirect github.com/bits-and-blooms/bitset v1.24.1 // indirect