var apiKey = "Test API Key"; // API Key not validated test environments
var posProductInfo = {
posProductVendor: "Acme Co",
posProductName: "Acme Cloud POS",
posProductVersion: "1.0.0"
};
var iclient = new TYRO.IClientWithUI(apiKey, posProductInfo);
var completionRef;
var amount;
var tabCompletionAmount;
var tabIncrementAmount;
var messageString = "Pre-auth Completion Reference: "
function pairing() {
var x = document.getElementById("iClientFrame")
x.src
= "https://iclientsimulator.test.tyro.com/configuration.html";
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
// Function to process the Open Tab request //
function openTab() {
reset();
//Setting the div colors back to original//
var element = document.getElementById("tabRef");
element.style.backgroundColor = "#ABBAEA";
element.style.color = "black";
var element2 = document.getElementById("result");
var color = element.style.color;
if (color == "red"){
toggleCrresult();
}
amount = $("#tabLimitAmount").val();
console.log(amount);
doOpenTab(amount);
console.log(amount);
}
function incrementTab(){
tabIncrementAmount = $("#tabIncrementAmount").val();
var element = document.getElementById("tabRef");
element.style.backgroundColor = "#ABBAEA";
element.style.color = "black";
doIncrementTab(completionRef, tabIncrementAmount);
}
//Function to process the Close Tab request//
function closeTab() { // no receipts are returned / printed for the close function
tabCompletionAmount = $("#tabCompletionAmount").val();
if (Number(tabCompletionAmount) > 0 &&
Number(tabCompletionAmount) <= Number(amount)) {
toggleClrResult("black");
doCloseTab(completionRef, tabCompletionAmount);
}
else if(tabCompletionAmount > amount){
toggleClrResult("red");
//window.alert("Tab Completion Amount Cannot be greater than the tab...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.