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.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 {
w.WriteHeader(http.StatusMethodNotAllowed)
return
@@ -128,9 +128,10 @@ func (a *App) HandleCheckoutRequests(amqpUrl string, mux *http.ServeMux, invento
if err != nil {
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)
if !ok {
log.Printf("Invalid cart id in order reference: %s", order.MerchantReference1)
w.WriteHeader(http.StatusBadRequest)
return
}