package main import ( "net/http" ) func (app *application) VirtualTerminal(w http.ResponseWriter, r *http.Request) { if err := app.renderTemplate(w, r, "terminal", nil); err != nil { app.errorLog.Println(err) } } func (app *application) PaymentSucceeded(w http.ResponseWriter, r *http.Request) { err := r.ParseForm() if err != nil { app.errorLog.Println(err) return } // read posted data cardHolder := r.Form.Get("cardholder_name") email := r.Form.Get("cardholder_email") paymentIntent := r.Form.Get("payment_intent") paymentMethod := r.Form.Get("payment_method") paymentAmount := r.Form.Get("payment_amount") paymentCurrency := r.Form.Get("payment_currency") data := make(map[string]interface{}) data["cardholder"] = cardHolder data["email"] = email data["pi"] = paymentIntent data["pm"] = paymentMethod data["pa"] = paymentAmount data["pc"] = paymentCurrency if err := app.renderTemplate(w, r, "succeeded", &templateData{ Data: data, }); err != nil { app.errorLog.Println(err) } }