1/* 2 * Copyright (c) 2021 Nexi Payments S.p.A. 3 * @author iPlusService S.r.l. 4 * @copyright Copyright (c) 2021 Nexi Payments S.p.A. (https://ecommerce.nexi.it) 5 * @license GNU General Public License v3.0 6 * @category Payment Module 7 * @version 5.3.0 8 */ 9 10$(document).ready(function () { 11 const SELECTED_TOKEN_NEW = "NEW"; 12 13 getInstallmentsLabel(); 14 15 if (!window.ApplePaySession && $('*[data-module-name="APPLEPAY"]').length) { 16 $('*[data-module-name="APPLEPAY"]')[0].parentNode.parentNode.remove(); 17 } 18 19 $(document).on("change", "#pagodil-installments-number", function () { 20 $("#installments").val($(this).val()); 21 22 window.localStorage.setItem("lastSelectedInstallments", parseInt($(this).val())); 23 24 getInstallmentsLabel(); 25 }); 26 27 function getInstallmentsAmount() { 28 var total = $("#totalAmount").val(); 29 var total_recurrences = $("#installments").val(); 30 31 return (total / total_recurrences).toFixed(2); 32 } 33 34 function getInstallmentsLabel() { 35 var installmentLabel = $("#installmentLabel").val(); 36 var total_recurrences = $("#installments").val(); 37 38 if ($("#installmentLabel").val() && $("#installments").val()) { 39 $("#installment-text").html( 40 pagodilSprintf(installmentLabel, total_recurrences, getInstallmentsAmount()) 41 ); 42 } 43 } 44 45 function pagodilSprintf(str, ...argv) { 46 if (argv.length) { 47 return pagodilSprintf(str.replace("$", argv.shift()), ...argv); 48 } else { 49 return str; 50 } 51 } 52 53 $('#nexi-payment-form input[name="selected_token"]').on("change", function () { 54 if ($(this).val() == SELECTED_TOKEN_NEW) { 55 $("#save-token-checkbox").show(); 56 $('#save-token-checkbox input[name="save_token"]').attr("disabled", false); 57 } else { 58 $("#save-token-checkbox").hide(); 59 $('#save-token-checkbox input[name="save_token"]').attr("disabled", true); 60 } 61 }); 62});
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.