Last step ⬇️⬇️⬇️
<br><br>
<a href="'+URL+'"
style="padding: 10px 15px;
background-color:#b494f1;
border-radius:30px;
color:white;">Payment</a>
Ideal for any dessert. Especially with whipped cream
Price: $1.6
An excellent source of vitamins and iron. And it's also very tasty.
Price: $2
We all know how much minions love them
Price: $2.5
<div id="mkd-wrap">
<h1>{TEMPLATE FIELD}</h1>
<p>{TEMPLATE FIELD}</p>
<p>Price: ${TEMPLATE FIELD}</p>
<button id="myButton" onclick="sendData('{TEMPLATE FIELD ID}', 'true')">Buy</button>
</div>
<script>
function sendData(id, buy) {
var xhr = new XMLHttpRequest();
var url = 'YOU ENDPOINT';
var params = 'id=' + id + '&buy=' + buy; //id - id card, buy - bool trigger
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.send(params);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
var response = JSON.parse(xhr.responseText);
var redirectURL = response.url;
window.location.href = redirectURL;
}
}
}
</script>