From 625929cf254dd9153b964609d760d85a547deebf Mon Sep 17 00:00:00 2001 From: vinchent Date: Wed, 7 Aug 2024 12:17:26 +0200 Subject: [PATCH] fix incoherence of amount between pages --- cmd/web/templates/stripe-js.partial.gohtml | 2 +- cmd/web/templates/terminal.page.gohtml | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cmd/web/templates/stripe-js.partial.gohtml b/cmd/web/templates/stripe-js.partial.gohtml index 8ff5971..860a631 100644 --- a/cmd/web/templates/stripe-js.partial.gohtml +++ b/cmd/web/templates/stripe-js.partial.gohtml @@ -46,7 +46,7 @@ function val() { form.classList.add("was-validated"); hidePayButton(); - let amountToCharge = String(parseFloat(document.getElementById("amount").value)); + let amountToCharge = parseFloat(document.getElementById("amount").value); let payload = { amount: amountToCharge, currency: 'eur', diff --git a/cmd/web/templates/terminal.page.gohtml b/cmd/web/templates/terminal.page.gohtml index 3fb3511..0fc5cc0 100644 --- a/cmd/web/templates/terminal.page.gohtml +++ b/cmd/web/templates/terminal.page.gohtml @@ -16,9 +16,9 @@ Virtual Terminal
@@ -76,5 +76,14 @@ Virtual Terminal {{ end }} {{ define "js" }} + {{ template "stripe-js" . }} {{ end }}