1/** 2 * Copyright (c) 2019 Nexi Payments S.p.A. 3 * 4 * @author iPlusService S.r.l. 5 * @category Payment Module 6 * @package Nexi XPay 7 * @version 6.0.0 8 * @copyright Copyright (c) 2019 Nexi Payments S.p.A. (https://ecommerce.nexi.it) 9 * @license GNU General Public License v3.0 10 */ 11 12function checkApplePay($) { 13 if (!window.ApplePaySession) { 14 if ($(".payment_method_xpay_applepay").length) { 15 $(".payment_method_xpay_applepay").remove(); 16 } 17 18 if ($(".payment_method_xpay_npg_applepay").length) { 19 $(".payment_method_xpay_npg_applepay").remove(); 20 } 21 } 22} 23 24(function ($) { 25 $(document).ready(function () { 26 receipt_form = $("#nexi_xpay_receipt_form"); 27 28 if (receipt_form.length > 0) { 29 receipt_form.submit(); 30 } 31 32 checkApplePay($); 33 34 setInterval(function () { 35 checkApplePay($); 36 }, 700); 37 38 $(document).on("change", "#pagodil-installments-number", function () { 39 window.localStorage.setItem( 40 "lastSelectedInstallments", 41 parseInt($("#pagodil-installments-number").val()), 42 ); 43 44 installmentsCalc(); 45 46 if ($("#installments")) { 47 $("#installments").val($("#pagodil-installments-number").val()); 48 } 49 }); 50 51 jQuery("form.checkout").on("change", 'input[name="payment_method"]', function () { 52 if ( 53 jQuery('input[name="payment_method"]:checked').val() === "xpay_googlepay_button" || 54 jQuery('input[name="payment_method"]:checked').val() === "xpay_applepay_button" 55 ) { 56 jQuery("#place_order").hide(); 57 } else { 58 jQuery("#place_order").show(); 59 } 60 }); 61 }); 62})(jQuery); 63 64function installmentsCalc() { 65 var admin_url = jQuery("#xpay_admin_url").val(); 66 67 jQuery.ajax({ 68 type: "POST", 69 data: { 70 action: "calc_installments", 71 installments: jQuery("#pagodil-installments-number").val(), 72 }, 73 url: admin_url + "admin-ajax.php", 74 success: function (response) { 75 jQuery("#pagodil-installment-info").html(response.installmentsLabel); 76 }, 77 complete: function () {}, 78 }); 79}
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.