reupload latest seatmap main
This commit is contained in:
@@ -13,7 +13,7 @@ var idCartModal;
|
||||
var ProductManager;
|
||||
var seatmapWorkflowURL;
|
||||
|
||||
const branch = 'seatmap_main'; // seatmap_testing or seatmap_main
|
||||
const branch = 'seatmap_testing'; // seatmap_testing or seatmap_main
|
||||
var DATA = {
|
||||
'CONFIG': {},
|
||||
};
|
||||
@@ -27,10 +27,11 @@ function set_predefined_config(DATA) {
|
||||
if (typeof DATA.CONFIG['SEATMAP_VERSION'] != 'undefined') {
|
||||
DATA.CONFIG["SEATMAP_VERSION"] = DATA.CONFIG["SEATMAP_VERSION"] + ' (testing)';
|
||||
}
|
||||
DATA.CONFIG['SEATMAP-SERVER']['ROOT_URL'] = 'https://seatmap-testing.zinomedia.de/seatmap-server/seatmap-server.pl';
|
||||
DATA.CONFIG['SEATMAP-SERVER']['ROOT_URL'] = 'https://staging.purchase.tickets.zinomedia.de/seatmap-server/seatmap-server.pl';
|
||||
}
|
||||
else if (branch === 'seatmap_main') {
|
||||
DATA.CONFIG['SEATMAP-SERVER']['ROOT_URL'] = 'https://zinomedia.de/seatmap_main/seatmap-server/seatmap-server.pl';
|
||||
DATA.CONFIG["SEATMAP_VERSION"] = DATA.CONFIG["SEATMAP_VERSION"];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,8 +84,6 @@ if (!String.prototype.repeat) {
|
||||
document.addEventListener("DOMContentLoaded", ready);
|
||||
window.onload = function() {
|
||||
if (DATA.CONFIG['DEBUG']) console.log(getFuncName());
|
||||
|
||||
checkDebug();
|
||||
};
|
||||
|
||||
// EVENT CONTAINER VISIBLE
|
||||
@@ -93,13 +92,20 @@ if ($('.container-fluid').is(':visible')) {
|
||||
detect_die_IE();
|
||||
|
||||
// PARSE PARAM FROM POSTURL, CREATES param and extra_param
|
||||
var decoded_uri = decodeURIComponent(getParamValue('posturl'));
|
||||
let posturl = getParamValue('posturl');
|
||||
console.log('POSTURL: ' + posturl);
|
||||
|
||||
var decoded_uri = decodeURIComponent(posturl);
|
||||
getParamsFromPosturl(decoded_uri);
|
||||
if (DATA.CONFIG['DEBUG']) console.log(param);
|
||||
if (DATA.CONFIG['DEBUG']) console.log(extra_param);
|
||||
|
||||
// REMOVE PARAM FROM URL
|
||||
//window.history.replaceState(null, null, window.location.pathname);
|
||||
|
||||
// GET DATA FROM SERVER AND BUILD SEATMAP
|
||||
seatmapWorkflow(decoded_uri);
|
||||
//seatmapWorkflow(decoded_uri);
|
||||
seatmapWorkflow(posturl);
|
||||
}
|
||||
|
||||
function detect_die_IE() {
|
||||
@@ -118,7 +124,7 @@ function getParamsFromPosturl(decoded_uri) {
|
||||
var checkoutParam = [
|
||||
'APPTE', 'age_consent_is_checked', 'agency', 'cancelAndRedirectTrxState', 'cogid', 'coids', 'discount=A=IE', 'discount=A=IV', 'discountdesc=A=IE', 'discountdesc=A=IV', 'discountfees=A=IE', 'discountfees=A=IV', 'discountprice=A=IE', 'discountprice=A=IV', 'dpa_selection', 'etpgcode', 'flashDetected', 'gid', 'hbx_discount_prices', 'hbx_discounts', 'hbx_offered_pg', 'hbx_perf_codes', 'hbx_perf_sub_codes', 'hbx_pids', 'hbx_requested_pg', 'hbx_selected_tixx', 'hbx_upsell_flag', 'request_type', 'invalid_seats', 'inventory_filtering_action', 'inventory_month', 'inventory_year', 'isCapEnabled', 'is_availability_switch_from_map', 'is_ticket_exchange_request', 'ism_map_current_state_json_data', 'jcarousel_auto_off_val', 'listing_type', 'mainEventPID', 'map_coupon_code', 'mlbamsp', 'oid', 'ooids', 'orderkey', 'orgid', 'p_orgid', 'package_pids', 'parent_offer_id', 'pay_pal_token', 'pid', 'prevtrxstate', 'recapToken', 'redeem_voucher_data_event_mapping', 'replay_request', 'request_action', 's_mem_tkt_ren_retrieval', 'schedule', 'secure_trxn_enabled', 'selected_seat_indexes', 'selected_upsell_option', 'supplierCode', 'supplier_code', 'target_name_value', 'target_prev_trxstate', 'target_trxstate', 'target_url', 'timeout_seconds', 'trxstate', 'upsell_selected', 'user_context', 'valid_coupon_code_message',
|
||||
];
|
||||
var extraParam = ['note'];
|
||||
var extraParam = ['note', 'request_switch'];
|
||||
|
||||
for (var i = 0; i < checkoutParam.length; i++) {
|
||||
let value = getParamValue(checkoutParam[i], decoded_uri);
|
||||
@@ -695,15 +701,6 @@ function getParamValue(paramName, url) {
|
||||
}
|
||||
}
|
||||
|
||||
function checkDebug() {
|
||||
if (DATA.CONFIG['DEBUG']) console.log(getFuncName());
|
||||
|
||||
// if (DATA.CONFIG["DEBUG"]) {
|
||||
// }
|
||||
// else if (!DATA.CONFIG["DEBUG"]) {
|
||||
// }
|
||||
}
|
||||
|
||||
function checkMobile() {
|
||||
console.log(getFuncName());
|
||||
|
||||
@@ -785,16 +782,17 @@ function getFuncName(arg) {
|
||||
}
|
||||
|
||||
// SEATMAP
|
||||
function seatmapWorkflow(decodedURI) {
|
||||
function seatmapWorkflow(URI) {
|
||||
if (DATA.CONFIG['DEBUG']) console.log(getFuncName());
|
||||
|
||||
seatmapWorkflowURL = DATA.CONFIG["SEATMAP-SERVER"]["ROOT_URL"] + "?url=" + decodedURI;
|
||||
if (DATA.CONFIG['DEBUG']) console.log("Get: " + seatmapWorkflowURL);
|
||||
|
||||
jqxhr = $.getJSON(seatmapWorkflowURL, function(DATA) {
|
||||
//seatmapWorkflowURL = DATA.CONFIG["SEATMAP-SERVER"]["ROOT_URL"] + "?url=" + decodedURI;
|
||||
//if (DATA.CONFIG['DEBUG']) console.log("Get: " + seatmapWorkflowURL);
|
||||
//let seatmapWorkflowURLEncoded = DATA.CONFIG["SEATMAP-SERVER"]["ROOT_URL"] + "?url=" + encodeURIComponent(URI);
|
||||
let seatmapWorkflowURLEncoded = DATA.CONFIG["SEATMAP-SERVER"]["ROOT_URL"] + "?url=" + URI;
|
||||
if (DATA.CONFIG['DEBUG']) console.log("Get: " + seatmapWorkflowURLEncoded);
|
||||
|
||||
jqxhr = $.getJSON(seatmapWorkflowURLEncoded, function(DATA) {
|
||||
if (DATA.CONFIG['DEBUG']) console.log("success");
|
||||
|
||||
//replaceUmlautsDATA(DATA);
|
||||
|
||||
// MERGE PREDEFINED AND SERVER SETTINGS
|
||||
set_predefined_config(DATA);
|
||||
@@ -809,9 +807,7 @@ function seatmapWorkflow(decodedURI) {
|
||||
.done(function(DATA) {
|
||||
if (DATA.CONFIG['DEBUG']) console.log("second success");
|
||||
|
||||
// MERGE PREDEFINED AND SERVER SETTINGS
|
||||
//set_predefined_config(DATA);
|
||||
console.log(DATA);
|
||||
if (DATA.CONFIG['DEBUG']) console.log(DATA);
|
||||
|
||||
manipulateHTML(DATA);
|
||||
})
|
||||
@@ -834,22 +830,15 @@ function replaceUmlautsDATA(DATA) {
|
||||
}
|
||||
|
||||
function fillSeatObjData(id, DATA) {
|
||||
|
||||
console.log(DATA);
|
||||
if (DATA.CONFIG['DEBUG']) console.log(getFuncName());
|
||||
|
||||
// Seat Object
|
||||
var seatObj = sc.get(id);
|
||||
console.log(seatObj);
|
||||
console.log(seatObj.settings.status);
|
||||
|
||||
// RETURN IF ALREADY FILLED
|
||||
// if (seatObj.data().filled == true) {
|
||||
// console.log("seatObj already filled -> Return.");
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
||||
if (DATA.CONFIG['DEBUG']) {
|
||||
console.log(DATA);
|
||||
console.log(seatObj);
|
||||
}
|
||||
|
||||
// GET SECTION ID, ROW AND SEATNR FOR IDENTIFICATION
|
||||
var arrID = id.split('_'),
|
||||
@@ -871,13 +860,8 @@ function fillSeatObjData(id, DATA) {
|
||||
// console.log(buyerTypesObj);
|
||||
|
||||
// ROW AND PRODUCT TITLE
|
||||
// var jQueryRow = seatObj.settings.row + 1;
|
||||
// var product = seatObjJSON['SECTIONID_DESC'] + ' Reihe ' + jQueryRow + ' Platz ' + seatObjJSON.SEATNR_PARSED; // SHOWS IN CART
|
||||
var product = seatObjJSON['SECTIONID_DESC'] + ' Reihe ' + seatObjJSON['ROW_PARSED'] + ' Platz ' + seatObjJSON.SEATNR_PARSED; // SHOWS IN CART
|
||||
var productJBox = seatObjJSON['SECTIONID_DESC'] + ' Reihe ' + seatObjJSON['ROW_PARSED'] + ' Platz ' + seatObjJSON.SEATNR_PARSED + ' | ' + seatObj.data().price + DATA.CONFIG["CURRENCY_SYMBOL"]; // SHOWS IN JBOX
|
||||
// var product = seatObjJSON['SECTIONID_DESC'] + ' Reihe ' + jQueryRow + ' Platz ' + seatNr; // SHOWS IN CART
|
||||
// var productJBox = seatObjJSON['SECTIONID_DESC'] + ' Reihe ' + jQueryRow + ' Platz ' + seatNr + ' | ' + seatObj.data().price + DATA.CONFIG["CURRENCY_SYMBOL"]; // SHOWS IN JBOX
|
||||
// var productJBox = seatObjJSON['SECTIONID_DESC'] + ' Reihe ' + seatObjJSON['ROW_PARSED'] + ' Platz ' + seatNr + ' | ' + seatObj.data().price + DATA.CONFIG["CURRENCY_SYMBOL"]; // SHOWS IN JBOX
|
||||
|
||||
// SEAT COLOR
|
||||
var seatColor = pricescalesObj.COLOR;
|
||||
@@ -952,7 +936,7 @@ function manipulateHTML(DATA) {
|
||||
|
||||
document.getElementById("eventDesc").innerHTML = DATA.EVENT.DESC;
|
||||
document.getElementById("datetime_DE").innerHTML = 'Beginn: ' + DATA.EVENT.DATETIME_DE;
|
||||
document.getElementById("venueDesc").innerHTML = 'Ort: ' + DATA.VENUE.DESC;
|
||||
document.getElementById("venueDesc").innerHTML = 'Ort: ' + DATA.VENUE.DESC.toUpperCase();
|
||||
document.getElementById("seatmap_version").innerHTML = 'Version ' + DATA.CONFIG["SEATMAP_VERSION"];
|
||||
|
||||
$('.container-fluid').css('visibility', 'visible');
|
||||
@@ -998,36 +982,18 @@ function generateSeats(DATA, mappingPricescalesSections) {
|
||||
|
||||
// LOOP PRICESCALES
|
||||
for (var pricescalesID in DATA.VENUE.PRICESCALES) {
|
||||
// SECTION_CONFIG OBJECT
|
||||
// OBJECTS
|
||||
var sectionID = mappingPricescalesSections[pricescalesID];
|
||||
var sectionObj = DATA.VENUE.SECTION_CONFIG[sectionID];
|
||||
var pricescalesObj = DATA.VENUE.PRICESCALES[pricescalesID];
|
||||
|
||||
// if (DATA.CONFIG.hasOwnProperty("CUSTOM_PRICESCALES_COLOR")) {
|
||||
|
||||
// console.log(DATA.CONFIG);
|
||||
// var venueCode = DATA.VENUE.CODE;
|
||||
// venueCode.toString();
|
||||
// console.log('venueCode: ' + venueCode);
|
||||
|
||||
// console.log(DATA["CONFIG"][venueCode]["CUSTOM_PRICESCALES_COLOR"]);
|
||||
|
||||
// var resolve2 = resolve(DATA.VENUE.CODE, DATA.CONFIG);
|
||||
// console.log(resolve2);
|
||||
|
||||
//resolve(['object', 'a.property.name.with.periods'], DATA.CONFIG) // returns 42
|
||||
//console.log(Object.byString(DATA, 'CONFIG["INT_TH_3"].MAX_TICKETS_PER_USER'));
|
||||
|
||||
//console.log(DATA.CONFIG["INT_TH3_"]);
|
||||
//console.log(DATA.CONFIG["venue_code"]);
|
||||
if (typeof DATA.CONFIG[DATA.VENUE.CODE]["CUSTOM_PRICESCALES_COLOR"] != "undefined") {
|
||||
console.log("Applying custom colors");
|
||||
if (DATA.CONFIG['DEBUG']) console.log("Applying custom colors");
|
||||
cssProperties = '{' +
|
||||
'background-color: #' + DATA.CONFIG[DATA.VENUE.CODE]["CUSTOM_PRICESCALES_COLOR"][pricescalesObj.ID] + ' !important;' +
|
||||
'}';
|
||||
}
|
||||
else {
|
||||
console.log("Applying colors from XML");
|
||||
if (DATA.CONFIG['DEBUG']) console.log("Applying colors from XML");
|
||||
cssProperties = '{' +
|
||||
'background-color: #' + pricescalesObj.COLOR + ' !important;' +
|
||||
'}';
|
||||
@@ -1320,24 +1286,22 @@ function generateMapMatrix(DATA) {
|
||||
var overallMinMaxXY = getOverallMaxXY(DATA); // return [xMax, xMin, yMax, yMin, rowMax, maxSeats];
|
||||
var sortedSections = sortSeatmaps(DATA);
|
||||
var [mapping, matrixBIG] = bigMatrixDim(sortedSections);
|
||||
console.log('mapping: ');
|
||||
console.log(mapping);
|
||||
console.log('mapping.length: ' + Object.keys(mapping).length);
|
||||
console.log('matrixBIG:');
|
||||
console.log(matrixBIG);
|
||||
|
||||
// var matrixBIG = [
|
||||
// [],
|
||||
// []
|
||||
// ];
|
||||
if (DATA.CONFIG['DEBUG']) {
|
||||
console.log('mapping: ');
|
||||
console.log(mapping);
|
||||
console.log('mapping.length: ' + Object.keys(mapping).length);
|
||||
console.log('matrixBIG:');
|
||||
console.log(matrixBIG);
|
||||
console.log('overallMinMaxXY:');
|
||||
console.log(overallMinMaxXY);
|
||||
console.log("Overall maxmimum seats per row: " + overallMinMaxXY[5]);
|
||||
}
|
||||
|
||||
var seatsUnavailable = new Array();
|
||||
var mappingPricescalesSections = new Array();
|
||||
var jQuerySeatID;
|
||||
|
||||
if (DATA.CONFIG['DEBUG']) console.log('overallMinMaxXY:');
|
||||
if (DATA.CONFIG['DEBUG']) console.log(overallMinMaxXY);
|
||||
if (DATA.CONFIG['DEBUG']) console.log("Overall maxmimum seats per row: " + overallMinMaxXY[5]);
|
||||
|
||||
// LOOP THROUGH SORTED SECTIONS
|
||||
for (var k in sortedSections) {
|
||||
// SECTION OBJ
|
||||
@@ -1363,33 +1327,32 @@ function generateMapMatrix(DATA) {
|
||||
var seatDiff;
|
||||
if (maxSectionSeats != overallMaxSectionSeats) {
|
||||
seatDiff = overallMaxSectionSeats - maxSectionSeats;
|
||||
console.log("seatDiff: " + seatDiff);
|
||||
if (DATA.CONFIG['DEBUG']) console.log("seatDiff: " + seatDiff);
|
||||
if (seatDiff > 0) {
|
||||
if (seatDiff & 1) { // ODD
|
||||
console.log("Odd");
|
||||
offsetLeft = Math.floor(seatDiff / 2);
|
||||
offsetRight = Math.floor((seatDiff / 2)) + (seatDiff % 2);
|
||||
var remainder = seatDiff % 2;
|
||||
console.log("Remainder: " + remainder);
|
||||
|
||||
|
||||
if (DATA.CONFIG['DEBUG']) console.log("Odd & Remainder: " + remainder);
|
||||
}
|
||||
else { // EVEN
|
||||
console.log("Even");
|
||||
offsetRight = seatDiff / 2;
|
||||
offsetLeft = seatDiff / 2;
|
||||
|
||||
if (DATA.CONFIG['DEBUG']) console.log('Even');
|
||||
}
|
||||
console.log("offsetLeft: " + offsetLeft + " offsetRight: " + offsetRight);
|
||||
if (DATA.CONFIG['DEBUG']) console.log("offsetLeft: " + offsetLeft + " offsetRight: " + offsetRight);
|
||||
}
|
||||
}
|
||||
else {
|
||||
seatDiff = 0;
|
||||
}
|
||||
console.log('overallMaxSectionSeats ' + overallMaxSectionSeats + " | maxSectionSeats " + maxSectionSeats + " | seatDiff: " + seatDiff);
|
||||
if (DATA.CONFIG['DEBUG']) console.log('overallMaxSectionSeats ' + overallMaxSectionSeats + " | maxSectionSeats " + maxSectionSeats + " | seatDiff: " + seatDiff);
|
||||
|
||||
// LOOP THROUGH ROWS
|
||||
var rowSection = 0;
|
||||
for (var i in sectionObj.ROWS) {
|
||||
console.log("ROW: " + i);
|
||||
rowSection++;
|
||||
|
||||
// LOOP THROUGH ROW SEATS
|
||||
@@ -1453,15 +1416,15 @@ function generateMapMatrix(DATA) {
|
||||
matrix[seatY].push("_");
|
||||
}
|
||||
}
|
||||
|
||||
console.log('mapping y: ' + mapping[sectionObj.ID]['y']);
|
||||
console.log('mapping x: ' + mapping[sectionObj.ID]['x']);
|
||||
// console.log('matrix: ' + matrix);
|
||||
// console.log('matrixBIG: ' + matrixBIG);
|
||||
|
||||
var y = mapping[sectionObj.ID]['y'];
|
||||
var x = mapping[sectionObj.ID]['x'];
|
||||
matrixBIG[y][x] = matrix;
|
||||
|
||||
if (DATA.CONFIG['DEBUG']) {
|
||||
console.log('mapping y: ' + mapping[sectionObj.ID]['y']);
|
||||
console.log('mapping x: ' + mapping[sectionObj.ID]['x']);
|
||||
}
|
||||
}
|
||||
|
||||
if (DATA.CONFIG['DEBUG']) console.log(matrixBIG);
|
||||
@@ -1483,10 +1446,13 @@ function generateMapMatrix(DATA) {
|
||||
}
|
||||
}
|
||||
|
||||
if (DATA.CONFIG['DEBUG']) console.log(map1d);
|
||||
if (DATA.CONFIG['DEBUG']) console.log(seatsUnavailable);
|
||||
if (DATA.CONFIG['DEBUG']) console.log(mappingPricescalesSections);
|
||||
if (DATA.CONFIG['DEBUG']) console.log(rows);
|
||||
if (DATA.CONFIG['DEBUG']) {
|
||||
console.log(map1d);
|
||||
console.log(seatsUnavailable);
|
||||
console.log(mappingPricescalesSections);
|
||||
console.log(rows);
|
||||
}
|
||||
|
||||
return [map1d, seatsUnavailable, mappingPricescalesSections, rows];
|
||||
}
|
||||
|
||||
@@ -1495,16 +1461,12 @@ function seperateSeatmapsCSS(DATA) {
|
||||
|
||||
// ROW NODES OBJECT
|
||||
var nodes = document.getElementById('seat-map').childNodes;
|
||||
console.log(nodes);
|
||||
console.log(nodes.length);
|
||||
var sortedSections = sortSeatmaps(DATA);
|
||||
|
||||
// IF ONLY 1 SECTION
|
||||
console.log(Object.keys(DATA.VENUE.SEATMAP_CONFIG).length);
|
||||
if (Object.keys(DATA.VENUE.SEATMAP_CONFIG).length == 1) {
|
||||
if (DATA.CONFIG['DEBUG']) console.log("NOT MORE THAN 1 SECTION AVAILABLE. RETURN.");
|
||||
var sectionObj = sortedSections[0][1];
|
||||
console.log(sortedSections);
|
||||
|
||||
// INSERT INDICATOR
|
||||
if (DATA.CONFIG[DATA.VENUE.CODE]["BUEHNE"] === "TOP") {
|
||||
@@ -1623,11 +1585,10 @@ function checkoutGenerateURL(selected_seat_indexes) {
|
||||
|
||||
function checkoutCheckResponse(selected_seat_indexes, DATA) {
|
||||
if (DATA.CONFIG['DEBUG']) console.log(getFuncName());
|
||||
|
||||
console.log(DATA);
|
||||
|
||||
var rootURL = 'https://purchase.tickets.com/buy/TicketPurchase';
|
||||
var rootURLNoSlash = 'purchase.tickets.com/buy/TicketPurchase';
|
||||
var successful;
|
||||
|
||||
|
||||
var parameter = '';
|
||||
for (var property in param) {
|
||||
@@ -1638,55 +1599,61 @@ function checkoutCheckResponse(selected_seat_indexes, DATA) {
|
||||
parameter = parameter.substring(0, parameter.length - 1);
|
||||
parameter = parameter + "&trxstate=148&selected_seat_indexes=" + selected_seat_indexes;
|
||||
|
||||
// console.log(parameter);
|
||||
// var parameter_proxy = "trxstate=148&pid=" + param["pid"] + "&user_context=" + param["user_context"] + "&selected_seat_indexes=" + selected_seat_indexes;
|
||||
// var checkoutURLNoSlash = decodeURIComponent(rootURLNoSlash + '?' + parameter_proxy);
|
||||
var checkoutURLNoSlash = decodeURIComponent(rootURLNoSlash + '?' + parameter);
|
||||
var proxyCheckoutURL = DATA.CONFIG["CORS-ANYWHERE"]["ROOT_URL"] + checkoutURLNoSlash;
|
||||
if (DATA.CONFIG['DEBUG']) console.log('Get: ' + proxyCheckoutURL);
|
||||
// PROXY CHECKOUT URL
|
||||
//var rootURLNoSlash = 'purchase.tickets.com:443/buy/TicketPurchase';
|
||||
let rootURLNoSlash = 'https://purchase.tickets.com/buy/TicketPurchase';
|
||||
//var checkoutURLNoSlash = decodeURIComponent(rootURLNoSlash + '?' + parameter);
|
||||
//var proxyCheckoutURL = DATA.CONFIG["CORS-ANYWHERE"]["ROOT_URL"] + checkoutURLNoSlash;
|
||||
|
||||
|
||||
var checkoutURLNoSlash = encodeURIComponent(rootURLNoSlash + '?' + parameter + '&request_switch=checkoutCheckResponse');
|
||||
let checkoutCheckResponseURI = DATA.CONFIG["SEATMAP-SERVER"]["ROOT_URL"] + "?url=" + checkoutURLNoSlash;
|
||||
|
||||
var checkoutURL;
|
||||
if (param.hasOwnProperty("orderkey")) {
|
||||
console.log("ADD ANOTHER TICKET DETECTED");
|
||||
if (DATA.CONFIG['DEBUG']) console.log("ADD ANOTHER TICKET DETECTED");
|
||||
var parameter_30 = 'user_context=' + param['user_context'] + '&orderkey=' + param['orderkey'] + '&orgid=' + param['orgid'] + '&trxstate=30';
|
||||
checkoutURL = decodeURIComponent(rootURL + '?' + parameter_30);
|
||||
}
|
||||
else {
|
||||
console.log("FIRST TICKET DETECTED");
|
||||
if (DATA.CONFIG['DEBUG']) console.log("FIRST TICKET DETECTED");
|
||||
checkoutURL = decodeURIComponent(rootURL + '?' + parameter);
|
||||
}
|
||||
|
||||
var successful;
|
||||
$.ajax({
|
||||
url: proxyCheckoutURL,
|
||||
// headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
||||
method: 'GET',
|
||||
dataType: 'html',
|
||||
success: function(data) {
|
||||
// if (DATA.CONFIG['DEBUG']) console.log(data);
|
||||
|
||||
data = data.replace(/(?:\r\n|\r|\n|\t| {2,})/g, '');
|
||||
// console.log(data);
|
||||
var errorMsg = data.match(/<input type="hidden" name="no_timeout_error_msg" id="no_timeout_error_msg" value="(.*?)" \/>/)[1];
|
||||
console.log(errorMsg);
|
||||
|
||||
if (errorMsg === '') {
|
||||
successful = true;
|
||||
|
||||
|
||||
if (DATA.CONFIG['DEBUG']) {
|
||||
console.log(DATA);
|
||||
//console.log('proxyCheckoutURL: ' + proxyCheckoutURL);
|
||||
//console.log('checkoutURL:' + checkoutURL);
|
||||
console.log('checkoutCheckResponseURI: ' + checkoutCheckResponseURI);
|
||||
}
|
||||
|
||||
if (DATA.CONFIG['DEBUG']) console.log("DATA['CONFIG']['CHECKOUT-AVAILABILITY-CHECK']: " + DATA['CONFIG']['CHECKOUT-AVAILABILITY-CHECK']);
|
||||
|
||||
if( DATA['CONFIG']['CHECKOUT-AVAILABILITY-CHECK'] == 'enabled' ) {
|
||||
if (DATA.CONFIG['DEBUG']) console.log('CHECKOUT-AVAILABILITY-CHECK enabled');
|
||||
|
||||
$.getJSON(checkoutCheckResponseURI,
|
||||
function(data) {
|
||||
if (DATA.CONFIG['DEBUG']) console.log(data);
|
||||
|
||||
|
||||
if( data['no_timeout_error_msg']['value'] === '' ) {
|
||||
console.log('Good to go');
|
||||
successful = 1;
|
||||
|
||||
ProductManager.clearProduct();
|
||||
$cartBadge.text(ProductManager.getTotalQuantity());
|
||||
$("#" + idCartModal).modal("hide");
|
||||
|
||||
|
||||
// REDIRECT TO TICKET PURCHASE
|
||||
console.log('successfull, now going to: ' + checkoutURL);
|
||||
window.location.replace(checkoutURL);
|
||||
// window.open(checkoutURL, '_blank');
|
||||
// window.location.replace(proxyCheckoutURL);
|
||||
if (DATA.CONFIG['DEBUG']) console.log('successfull, now going to: ' + checkoutURL);
|
||||
//window.location.replace(checkoutURL);
|
||||
}
|
||||
else {
|
||||
successful = false;
|
||||
errorMsg = errorMsg.replace(/\<br\>/g, ' ');
|
||||
|
||||
else if( data['no_timeout_error_msg']['value'] !== '' ) {
|
||||
console.log('We have an error');
|
||||
successful = 0;
|
||||
|
||||
let errorMsg = data['no_timeout_error_msg']['value'].replace(/\<br\>/g, ' ');
|
||||
new jBox('Notice', {
|
||||
content: errorMsg,
|
||||
color: 'red',
|
||||
@@ -1697,18 +1664,58 @@ function checkoutCheckResponse(selected_seat_indexes, DATA) {
|
||||
closeButton: 'box',
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
else if( DATA['CONFIG']['CHECKOUT-AVAILABILITY-CHECK'] == 'disabled' ) {
|
||||
if (DATA.CONFIG['DEBUG']) console.log('CHECKOUT-AVAILABILITY-CHECK disabled');
|
||||
if (DATA.CONFIG['DEBUG']) console.log('Now going to: ' + checkoutURL);
|
||||
window.location.replace(checkoutURL);
|
||||
}
|
||||
|
||||
|
||||
// var successful;
|
||||
// $.ajax({
|
||||
// url: checkoutCheckResponseURI,
|
||||
// method: 'GET',
|
||||
// dataType: 'html',
|
||||
// //headers: { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Language': 'de,en-US;q=0.7,en;q=0.3', 'Host': 'purchase.tickets.com' },
|
||||
// headers: { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Language': 'de,en-US;q=0.7,en;q=0.3' },
|
||||
// success: function(data) {
|
||||
// // CORS PROXY RESPONSE
|
||||
// data = data.replace(/(?:\r\n|\r|\n|\t| {2,})/g, '');
|
||||
// var errorMsg = data.match(/<input type="hidden" name="no_timeout_error_msg" id="no_timeout_error_msg" value="(.*?)" \/>/)[1];
|
||||
// if (DATA.CONFIG['DEBUG']) console.log('errorMsg: ' + errorMsg);
|
||||
|
||||
// if (errorMsg === '') {
|
||||
// successful = true;
|
||||
// ProductManager.clearProduct();
|
||||
// $cartBadge.text(ProductManager.getTotalQuantity());
|
||||
// $("#" + idCartModal).modal("hide");
|
||||
|
||||
// // REDIRECT TO TICKET PURCHASE
|
||||
// if (DATA.CONFIG['DEBUG']) console.log('successfull, now going to: ' + checkoutURL);
|
||||
// window.location.replace(checkoutURL);
|
||||
// }
|
||||
// else {
|
||||
// successful = false;
|
||||
// errorMsg = errorMsg.replace(/\<br\>/g, ' ');
|
||||
// new jBox('Notice', {
|
||||
// content: errorMsg,
|
||||
// color: 'red',
|
||||
// width: '100vw',
|
||||
// responsiveWidth: true,
|
||||
// position: { x: 'center', y: 'top' },
|
||||
// autoClose: 10000,
|
||||
// closeButton: 'box',
|
||||
// });
|
||||
// }
|
||||
|
||||
// }
|
||||
// });
|
||||
|
||||
return successful;
|
||||
}
|
||||
|
||||
function untickSeat(id) {
|
||||
if (DATA.CONFIG['DEBUG']) console.log(getFuncName());
|
||||
console.log(id);
|
||||
document.getElementById(id).click(); // Click on the checkbox
|
||||
}
|
||||
|
||||
function selectRefreshPrice(select) {
|
||||
if (DATA.CONFIG['DEBUG']) console.log(getFuncName());
|
||||
|
||||
@@ -1817,8 +1824,7 @@ function generateSeatmap(DATA) {
|
||||
return 'available';
|
||||
}
|
||||
else if (this.status() == 'unavailable') {
|
||||
//seat has been already booked
|
||||
console.log('unavailable');
|
||||
// SEAT ALREADY BOOKED
|
||||
return 'unavailable';
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user