Pay<\/span> <\/button><\/p>
Your payment has been received. Many thanks - AMT Marketing.<\/p><\/form><\/div><\/div><\/div>');stripe=Stripe("pk_live_yKZxngQ5guZaNP7qWBXW86qz");purchase={items:[{id:"7491"}]};document.querySelector("#stripePaymentModal button").disabled=!0;fetch("/create-payment-intent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(purchase)}).then(function(n){return n.json()}).then(function(n){var r=stripe.elements(),t=r.create("card",{style:{base:{color:"#32325d",fontFamily:"Arial, sans-serif",fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#32325d"}},invalid:{fontFamily:"Arial, sans-serif",color:"#fa755a",iconColor:"#fa755a"}}}),i;t.mount("#card-element");t.on("change",function(n){document.querySelector("#stripePaymentModal button").disabled=n.empty;document.querySelector("#card-error").textContent=n.error?n.error.message:""});i=document.getElementById("payment-form");i.addEventListener("submit",function(i){i.preventDefault();$("#name").val()==""||$("#email").val()==""||$("#line1").val()==""||$("#city").val()==""||$("#state").val()==""?alert("Please enter required fields."):payWithCard(stripe,t,n.clientSecret)})});var payWithCard=function(n,t,i){loading(!0);n.confirmCardPayment(i,{payment_method:{card:t,billing_details:{name:$("#name").val(),email:$("#email").val(),address:{city:$("#city").val(),line1:$("#line1").val(),line2:$("#line2").val(),postal_code:$("#postalcode").val()}}}}).then(function(n){n.error?showError(n.error.message):(orderComplete(n.paymentIntent.id),$.ajax({url:"/get-stripe-payment-details/"+n.paymentIntent.id,type:"post",cache:!1,success:function(){},error:function(){}}),console.log(n.paymentIntent))})},orderComplete=function(n){loading(!1);document.querySelector(".result-message").setAttribute("href","https://dashboard.stripe.com/test/payments/"+n);document.querySelector(".result-message").classList.remove("hidden");document.querySelector("#stripePaymentModal button").disabled=!0},showError=function(n){loading(!1);var t=document.querySelector("#card-error");t.textContent=n;setTimeout(function(){t.textContent=""},4e3)},loading=function(n){n?(document.querySelector("#stripePaymentModal button").disabled=!0,document.querySelector("#spinner").classList.remove("hidden"),document.querySelector("#button-text").classList.add("hidden")):(document.querySelector("#stripePaymentModal button").disabled=!1,document.querySelector("#spinner").classList.add("hidden"),document.querySelector("#button-text").classList.remove("hidden"))}