passing key using form

This commit is contained in:
2024-08-04 18:35:34 +02:00
parent bfaf8965b3
commit d3e477eebd
3 changed files with 8 additions and 3 deletions

View File

@ -75,7 +75,7 @@ const cardMessages = document.getElementById("card-messages");
const payButton = document.getElementById("pay-button");
const processing = document.getElementById("processing-payment");
stripe = Stripe(''); // TODO: Publish key to be added
stripe = Stripe('{{index .StringMap "publishable_key"}}');
function hidePayButton() {
payButton.classList.add("d-none");
@ -128,7 +128,7 @@ function val() {
body: JSON.stringify(payload),
};
fetch("http://localhost:4001/api/payment-intent", requestOptions)
fetch("{{index .API}}/api/payment-intent", requestOptions)
.then(response => response.text())
.then(response => {
let data;