1$(function() { 2 window.console || (window.console = {log:function(){}}); 3 var search = location.search.substring(1); 4 search = search?JSON.parse('{"' + search.replace(/&/g, '","').replace(/=/g,'":"') + '"}', 5 function(key, value) { return key===""?value:decodeURIComponent(value) }):{}; 6 console.log('url parameters', search); 7 8 search != undefined && !$.isEmptyObject(search) && processPaymentStatus(search); 9 10 function processPaymentStatus(data) { 11 12 var modal = $('#ipay88').find('.modal-content'); 13 var modal_title = $('#ipay88').find('.modal-title'); 14 var modal_body = $('#ipay88').find('.modal-body'); 15 var modal_footer = $('#ipay88').find('.modal-footer'); 16 17 if (data.error) { 18 console.log(data.error); 19 modal_title.empty().append('Error'); 20 modal_body.empty().append(data.error.replace(/\+/g, ' ')); 21 modal_footer.empty().append( 22 $('<button>').prop('type', 'button').addClass('btn btn-default').attr('data-dismiss', 'modal').append('Close') 23 ); 24 /* 25 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> 26 <button type="button" class="btn btn-primary">Save changes</button> 27 */ 28 } else if (data.payment_status && data.invoice_id) { 29 $.get(app.root + 'payments/getLink/' + data.invoice_id, function(res){ 30 console.log('payments/getLink', res); 31 if (res && res.link) { 32 if (data.payment_status == 0) { 33 modal_title.empty().append('Error'); 34 modal_body.empty().append('Something went wrong with the payment. You may ').append($('<a class="color-yellow">').append('try again here').prop('href', res.link)).append('.'); 35 modal_footer.empty().append( 36 $('<button>').prop('type', 'button').addClass('btn btn-default').attr('data-dismiss', 'modal').append('Close') 37 ); 38 } else { 39 modal_title.empty().append('Success'); 40 //modal_body.empty().append('We have received your payment. Your booking is currently pending for approval and you will be notified very shortly once there is an update on the booking status.'); 41 modal_body.empty().append('Thank you for booking with us and your payment has been received. If you have any question please do not hesitate to contact us.<br> Your booking id is: <strong>' + data.invoice_id + '</strong>'); 42 modal_footer.empty().append( 43 $('<button>').prop('type', 'button').addClass('btn btn-default').attr('data-dismiss', 'modal').append('Close') 44 ); 45 } 46 } 47 }); 48 } 49 50 $('#ipay88').modal('show'); 51 } 52});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.