From bf9485087d8f17e80a2fe3b882e6025ccffa9d6e Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Thu, 2 Jan 2020 10:35:00 +0100 Subject: [PATCH] refactor payment process - first step --- main.go | 1 + snippets/checkout.html | 102 ++++++++++++++++++++++++++ snippets/scales.html | 95 ++++++++++++++++++------ static/css/mini-beieli-web-custom.css | 32 ++++++++ stripe.go | 47 ++++++++++++ 5 files changed, 255 insertions(+), 22 deletions(-) create mode 100644 snippets/checkout.html diff --git a/main.go b/main.go index 5447be8..b6d07f6 100644 --- a/main.go +++ b/main.go @@ -89,6 +89,7 @@ func main() { http.HandleFunc("/lastmetrics", lastmetricsHandler) http.HandleFunc("/save_scale_settings", save_scale_settingsHandler) http.HandleFunc("/getstripesession", getstripesessionHandler) + http.HandleFunc("/getstripepaymentintent", getstripepaymentintentHandler) http.HandleFunc("/stripewebhook", stripeWebhookHandler) logit("Starting Web Application...") diff --git a/snippets/checkout.html b/snippets/checkout.html new file mode 100644 index 0000000..c71ab06 --- /dev/null +++ b/snippets/checkout.html @@ -0,0 +1,102 @@ +{{define "header_additions"}} + +{{end}} +{{define "body_content"}} +

Checkout

+ + + +
+ +
+ + + + + + + +{{end}} diff --git a/snippets/scales.html b/snippets/scales.html index d149bf0..ab0376e 100644 --- a/snippets/scales.html +++ b/snippets/scales.html @@ -1,3 +1,6 @@ +{{define "header_additions"}} + +{{end}} {{define "body_content"}} {{ if ne .UserName "" }} @@ -56,10 +59,21 @@ Device ID: -