<button id="send_1">Buy 1 day</button>
<button id="send_30">Buy 30 days</button>
<button id="send_100000">Buy Lifetime</button>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
$("#send_1").click(function () {
console.log("click");
hive_keychain.requestCustomJson(
null, 'sm_token_transfer', 'active', '{"to":"eclipsi","qty":95,"token":"DEC","type":"withdraw","app":"splinterviewer"}', '1 day',
function (response) {
console.log(response);
console.log(response.data.username);
console.log(response.result.id);
$.post("purchase.php", { name : response.data.username, days : 1 });
}
);
});
$("#send_30").click(function () {
console.log("click");
hive_keychain.requestCustomJson(
null, 'sm_token_transfer', 'active', '{"to":"eclipsi","qty":1195,"token":"DEC","type":"withdraw","app":"splinterviewer"}', '30 days.',
function (response) {
console.log(response);
console.log(response.data.username);
console.log(response.result.id);
$.post("purchase.php", { name : response.data.username, days : 30 });
}
);
});
$("#send_100000").click(function () {
console.log("click");
hive_keychain.requestCustomJson(
null, 'sm_token_transfer', 'active', '{"to":"eclipsi","qty":26995,"token":"DEC","type":"withdraw","app":"splinterviewer"}', 'Lifetime',
function (response) {
console.log(response);
console.log(response.data.username);
console.log(response.result.id);
$.post("purchase.php", { name : response.data.username, days : 100000 });
}
);
});
</script>
</body>
</html>
2.865 views
Ik heb drie knoppen op mijn website, deze doen telkens min of meer hetzelfde met iets andere info. Ik denk dat eenvoudiger zou moeten kunnen, maar weet niet excact hoe. Enige hulp?