diff --git a/main.go b/main.go index f16e50a..6e05907 100644 --- a/main.go +++ b/main.go @@ -54,6 +54,7 @@ func serveTemplate(w http.ResponseWriter, r *http.Request) { var datetimestring = t.Format("20060102150405") var scales = getMyDevs(userName) var last_metrics []OneMetric + var checkout_session_id string if (r.URL.Path == "/scales.html") || (r.URL.Path == "/abos.html") { // wir holen noch die letzten Metriken @@ -63,16 +64,25 @@ func serveTemplate(w http.ResponseWriter, r *http.Request) { } } + if (r.URL.Path == "/abos.html") { + // wir generieren die Stripe Session ID + checkout_session_id = GetStripeSessionID() + logit("Stripe Session ID: " + checkout_session_id) + + } + data := struct { UserName string DateTimeString string Scales []string LastMetrics []OneMetric + CheckoutSessionID string } { userName, datetimestring, scales, last_metrics, + checkout_session_id, } if err := tmpl.ExecuteTemplate(w, "layout", &data); err != nil { diff --git a/snippets/abos.html b/snippets/abos.html index 0cc1b4d..ce19261 100644 --- a/snippets/abos.html +++ b/snippets/abos.html @@ -8,13 +8,13 @@ {{range .LastMetrics}}
Zahlung abgebrochen!
+Zahlung wurde abgebrochen
+{{end}} diff --git a/snippets/payment_received.html b/snippets/payment_received.html new file mode 100644 index 0000000..4f5a207 --- /dev/null +++ b/snippets/payment_received.html @@ -0,0 +1,4 @@ +{{define "body_content"}} +Danke schoen!
+Danke fuer die Zahlung!
+{{end}} diff --git a/snippets/scales.html b/snippets/scales.html index 49dad53..c60281f 100644 --- a/snippets/scales.html +++ b/snippets/scales.html @@ -103,11 +103,11 @@ Device ID:
-
-
+
+ aktiv bis 01.01.1999
+
+
- Abo verlängern (aktiv bis 01.01.1999)