1 2window.addEventListener('load', function(e){}); 3var zestOrderData; 4function zestOnOrderAdd(orderData){ 5 zestOrderData = orderData; 6 if(orderData.payment == 'zest_payment'){ 7 addPaymentButton(); 8 var opts = getPaymentOpts(orderData.total, 'ÐплаÑа заказа â'+orderData.order_id, orderData.order_id); 9 ipayCheckout(opts, zestSuccessfulCallback, zestFailurefulCallback); 10 } 11} 12 13function getPaymentOpts(summ, title, orderId="") { 14 var options = { 15 amount: summ, 16 currency:'RUB', 17 order_number: orderId, 18 description: title 19 } 20 return options; 21} 22var zestSuccessfulCallback = function (order) { 23 zestOrderData = order; 24 zestAjaxOrderData(); 25}; 26 27var zestFailurefulCallback = function(order) { 28 zestOrderData = order; 29 zestOrderData = order; 30} 31function reTest(){ 32 zestAjaxOrderData(); 33} 34 35document.querySelector('.dev-btn').addEventListener('click', function(e){ 36 reTest(); 37}); 38 39function zestAjaxOrderData(){ 40 ajaxs( 'zest_after_payment', zestOrderData, 41 42 function(response){ 43 removePaymentButton(); 44 }, 45 function(response){}, 46 function(response){} 47 ); 48} 49 50function addPaymentButton(){ 51 var btnHtml = `<p class="zest-payment-btn-p" style="margin-top: 15px;"><a href="#" class="go js-zest-show-payment-form" >ÐплаÑиÑÑ</a></p>`; 52 var popupContent = document.querySelector('#order_success .in'); 53 popupContent.insertAdjacentHTML('beforeend', btnHtml); 54 setTimeout( function(){ 55 popupContent.querySelector('.js-zest-show-payment-form').addEventListener('click', handleZestShowPaymentForm); 56 }, 100); 57 58 59} 60function removePaymentButton(){ 61 document.querySelector('.js-zest-show-payment-form').removeEventListener('click', handleZestShowPaymentForm); 62 setTimeout(function(){ document.querySelector('#order_success .in .zest-payment-btn-p').remove(); }, 25); 63} 64function showSuccessMessage(){} 65function showFailMessage(){} 66 67function handleZestShowPaymentForm(e){ 68 var opts = getPaymentOpts(zestOrderData.total, 'ÐплаÑа заказа â'+zestOrderData.order_id, zestOrderData.order_id); 69 ipayCheckout(opts, zestSuccessfulCallback, zestFailurefulCallback); 70}
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.