update again. with more logs
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user