validate
This commit is contained in:
2
main.go
2
main.go
@@ -273,6 +273,7 @@ func main() {
|
|||||||
w.Write([]byte(fmt.Sprintf(tpl, order.HTMLSnippet)))
|
w.Write([]byte(fmt.Sprintf(tpl, order.HTMLSnippet)))
|
||||||
})
|
})
|
||||||
mux.HandleFunc("/validate", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("/validate", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
log.Printf("Klarna order validation, method: %s", r.Method)
|
||||||
if r.Method != "POST" {
|
if r.Method != "POST" {
|
||||||
w.WriteHeader(http.StatusMethodNotAllowed)
|
w.WriteHeader(http.StatusMethodNotAllowed)
|
||||||
return
|
return
|
||||||
@@ -282,6 +283,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
}
|
}
|
||||||
|
log.Printf("Klarna order validation: %s", order.ID)
|
||||||
err = confirmOrder(order, orderHandler)
|
err = confirmOrder(order, orderHandler)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error confirming order: %v\n", err)
|
log.Printf("Error confirming order: %v\n", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user