From 1e71ce1c350a0f1afb59a0159eceb551e0c7333a Mon Sep 17 00:00:00 2001 From: Dakota Walsh Date: Tue, 20 Jan 2026 11:06:17 +1300 Subject: [PATCH] Add debug printing --- main.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 8abed1d..a93c480 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ import ( "fmt" "log" "net/http" + "net/http/httputil" "os" "runtime/debug" @@ -105,9 +106,21 @@ func (app *application) routes() http.Handler { return standard.Then(mux) } -func (app *application) stripe(w http.ResponseWriter, r *http.Request) {} +func (app *application) stripe(w http.ResponseWriter, r *http.Request) { + res, err := httputil.DumpRequest(r, true) + if err != nil { + log.Fatal(err) + } + fmt.Print("Stripe:", string(res)) +} -func (app *application) paypal(w http.ResponseWriter, r *http.Request) {} +func (app *application) paypal(w http.ResponseWriter, r *http.Request) { + res, err := httputil.DumpRequest(r, true) + if err != nil { + log.Fatal(err) + } + fmt.Print("PayPal:", string(res)) +} // logRequest is a middleware that prints each request to the info log. func (app *application) logRequest(next http.Handler) http.Handler {