<script src="https://payment.qubotic.name/tmt-payment-modal.3.5.0.js"></script>
<script>
window.tmtPaymentModalReady = function () {
var tmtPaymentModal = new window.tmtPaymentModalSdk({
path: "tmt-test",
formId: "tmt-payment-form",
disableLang: false,
lang: "enGB",
disableCloseWindowPrompt: false,
debug: true,
environment: "test",
verify: [
"firstname",
"surname",
"email",
"date",
"reference",
"country",
"description",
"pax"
],
paymentMethods: [
"credit-card",
"alipay",
"dlocal",
"giropay",
"ideal",
"sofort",
"rapipago"
],
installments: [1, 3]
})
// Available Callbacks
tmtPaymentModal.on("token_error", function(data) {
console.log("TOKEN ERROR - ", data);
})
tmtPaymentModal.on("booking_logged", function(data) {
console.log("BOOKING LOGGED - ", data);
})
tmtPaymentModal.on("booking_exists", function (data) {
console.log("BOOKING EXISTS - ", data);
})
tmtPaymentModal.on("booking_error", function (data) {
console.log("BOOKING ERROR - ", data);
})
tmtPaymentModal.on("transaction_logged", function (data) {
console.log("TRANSACTION LOGGED - ", data);
tmtPaymentModal.closeModal();
// Get the transaction ID and add to a hidden input.
var idEl = document.getElementById("tmt_id");
idEl.value = data.id;
// Get the transaction total and add to a hidden input.
var idEl = document.getElementById("tmt_total");
idEl.value = data.total;
// Get the transaction status and add to a hidden input.
var idEl = document.getElementById("tmt_status");
idEl.value = data.status;
// Get the transaction hash and add to a hidden input.
var idEl = document.getElementById("tmt_hash");
idEl.value = data.hash;
// Submit form to validate hash prior to completion page.
var form = document.getElementById("tmt-payment-form");
form.submit();
})
tmtPaymentModal.on("transaction_failed", function (data) {
console.log("TRANSACTION FAILED - ", data);
// Get the transaction ID and add to a hidden input.
var idEl = document.getElementById("tmt_id");
idEl.value = data.id;
// Get the transaction total and add to a hidden input.
var idEl = document.getElementById("tmt_total");
idEl.value = data.total;
// Get the transaction status and add to a hidden input.
var idEl = document.getElementById("tmt_status");
idEl.value = data.status;
// Get the transaction hash and add to a hidden input.
var idEl = document.getElementById("tmt_hash");
idEl.value = data.hash;
// Submit form to validate hash prior to completion page.
var form = document.getElementById("tmt-payment-form");
form.submit();
})
tmtPaymentModal.on("transaction_timeout", function (data) {
console.log("TRANSACTION TIMEOUT - ", data);
})
tmtPaymentModal.on("transaction_error", function (data) {
console.log("TRANSACTION ERROR - ", data);
})
tmtPaymentModal.on("modal_closed", function (data) {
console.log("MODAL ClOSED - ", data);
})
tmtPaymentModal.on("close_window_attempted", function (data) {
console.log("USER ATTEMPTED TO CLOSE BROWSER WINDOW ", data);
})
}
</script>