fix incoherence of amount between pages
This commit is contained in:
parent
6d4b8236a5
commit
625929cf25
@ -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',
|
||||
|
@ -16,9 +16,9 @@ Virtual Terminal
|
||||
<div class="mb-3">
|
||||
<label for="amount" class="form-label">Amount</label>
|
||||
<input type="text"
|
||||
id="amount"
|
||||
name="amount"
|
||||
autocomplete="amount-new"
|
||||
id="charge_amount"
|
||||
name="charge_amount"
|
||||
autocomplete="charge_amount-new"
|
||||
required=""
|
||||
class="form-control">
|
||||
</div>
|
||||
@ -76,5 +76,14 @@ Virtual Terminal
|
||||
</form>
|
||||
{{ end }}
|
||||
{{ define "js" }}
|
||||
<script>
|
||||
document.getElementById("charge_amount", function(evt) {
|
||||
if (evt.target.value !== "") {
|
||||
document.getElementById("amount").value = evt.target.value * 100;
|
||||
} else {
|
||||
document.getElementById("amount").value = 0;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{ template "stripe-js" . }}
|
||||
{{ end }}
|
||||
|
Loading…
Reference in New Issue
Block a user