PageSourceSearch

https://www.dodho.com/wp-content/plugins/paytpv-for-woocommerce/js/paytpv.js?ver=5.41

js dodho.com collected 2026-09-24 09:16:25 UTC 6,250 bytes, 243 lines download raw bytes

1// Plugin
2
3jQuery(function($) {
4
5    window.saveOrderInfoJQ = function(){
6        paytpv_agree = $("#savecard").is(':checked')?1:0;
7
8        $.ajax({
9            url: $("#form_paytpv").attr("action"),
10            type: "POST",
11            data: {
12                'paytpv_agree': paytpv_agree,
13                'tpvLstr': 'savecard',
14                'Order': $("#order_id").val(),
15                'ajax': true
16            },
17            dataType:"json"
18        })
19    }
20
21    $("#direct_pay").on("click", function(e){
22        e.preventDefault();
23        $("#clockwait").show();
24        $(this).hide();
25        $(this).attr("disabled", true); // evitar doble check
26        $("#form_paytpv").submit();
27
28    });
29
30
31    window.checkCard = function(){
32
33        if ($("#card").val()=="0" || $("#card").val()==""){
34            $("#storingStep,#paytpv_iframe").removeClass("hidden").show();
35            $("#direct_pay").hide();
36        }else{
37            $("#storingStep,#paytpv_iframe").hide();
38            $("#direct_pay").show();
39        }
40    }
41
42    setTimeout(checkCard, 0);
43
44});
45
46
47
48jQuery(function($) {
49    if (typeof $.fn.select2 !== 'undefined') {
50        $('#form_paytpv #card').select2(); 
51    }
52
53    function alert(msg) {
54        lightcase.start({
55          href: '#'+msg,
56        });
57    }
58
59    window.vincularTarjeta = function(){
60
61        $("#ifr-paytpv-container-acount").attr('src',url_paytpv);
62        $('#savecard').attr("disabled", true);
63        $('#close_vincular').show();
64        if ($('#payment_paycomet').val()!=1) {
65            $('#nueva_tarjeta').show();
66            scrollToCard();
67            
68        } else {
69            window.open($('#ifr-paytpv-container-acount').attr('src'),'_self');
70        }
71
72        $('#open_vincular').hide();
73    }
74
75    window.close_vincularTarjeta = function (){
76        $('#savecard').attr("disabled", false);
77        $('#nueva_tarjeta').hide();
78        $('#close_vincular').hide();
79        $('#open_vincular').show();
80        $('#aviso-tokenizacion').css("display", "none");
81        $("#id_card").val("");
82        $("#option").val("");
83    }
84
85
86    window.scrollToCard = function () {        
87        $('html').animate(
88            {
89              scrollTop: $('#storingStepUser').offset().top,
90            },
91            800 //speed
92          );
93    }
94
95    $(".tokenizacion").click(function(e){
96        e.preventDefault();
97        getUrlIframe($(this));
98        $('#close_vincular').show();
99        $("#id_card").val($(this).attr("id"));
100        $("#option").val("tokenization");
101        if ($('#payment_paycomet').val()!=1) {
102            $('#aviso-tokenizacion').css("display", "block");
103            $('#nueva_tarjeta').show();
104            scrollToCard();  
105            
106        } 
107        $('#open_vincular').hide();
108        
109
110    });
111
112    $(".update").click(function(e){
113        e.preventDefault();
114        getUrlIframeExpired($(this));
115        $('#close_vincular').show();
116        $("#id_card").val($(this).attr("id"));
117        $("#option").val("update");
118        if ($('#payment_paycomet').val()!=1) {
119            $('#aviso-tokenizacion').css("display", "none");
120            $('#nueva_tarjeta').show();            
121            scrollToCard(); 
122        }
123        $('#open_vincular').hide();
124        
125    });
126
127    $(".remove_card").on("click", function(e){
128        e.preventDefault();
129        element = $(this);
130        id = $(this).attr("id");
131        cc_iduser = $("#cc_"+$(this).attr("id")).val()
132        if (confirm($(this).html() + ": " + cc_iduser)) {
133            removeCard(element);
134        };
135    });
136
137    $(".save_desc").on("click", function(e){
138        e.preventDefault();
139        card_desc = $("#card_desc_"+$(this).attr("id")).val()
140        saveDescriptionCard($(this));
141    });
142
143
144    window.saveDescriptionCard = function(element)
145    {
146
147        car_desc = $("#card_desc_"+element.attr("id")).val();
148        $.ajax({
149            url: element.attr("href"),
150            type: "POST",
151            data: {
152                'card_desc': car_desc,
153                'ajax': true
154            },
155            success: function(result)
156            {
157                if (result.resp == '0')
158                {
159                   alert("#msg_descriptionsaved")
160
161                }
162            },
163            dataType:"json"
164        });
165
166    };
167
168
169    window.removeCard = function(element)
170    {
171       
172        $.ajax({
173            url: element.attr("href"),
174            type: "POST",
175            data: {
176                'ajax': true
177            },
178            success: function(result)
179            {
180                if (result.resp == '0')
181                {
182                   $("#card_"+id).fadeOut(1000);
183                }
184            },
185            dataType:"json"
186        });
187        window.location.reload();
188    };
189
190
191    window.getUrlIframe = function(element)
192    {
193  
194        $.ajax({
195            url: element.attr("href"),
196            type: "POST",
197            data: {
198                'tpvLstr': 'getUrlIframe',
199                'card_id': element.attr("id"),
200                'ajax': true
201            },
202            success: function(result)
203            {
204                if (result.resp == '0')
205                {
206                    $("#ifr-paytpv-container-acount").attr('src',result.url);
207                    if ($('#payment_paycomet').val()==1) {
208                        window.open($('#ifr-paytpv-container-acount').attr('src'),'_self');
209                    }
210                }
211            },
212            dataType:"json"
213        })
214    }
215
216    window.getUrlIframeExpired = function(element)
217    {
218  
219        $.ajax({
220            url: element.attr("href"),
221            type: "POST",
222            data: {
223                'tpvLstr': 'getUrlIframeExpired',
224                'card_id': element.attr("id"),
225                'ajax': true
226            },
227            success: function(result)
228            {
229                if (result.resp == '0')
230                {
231                    $("#ifr-paytpv-container-acount").attr('src',result.url);
232                    if ($('#payment_paycomet').val()==1) {
233                        window.open($('#ifr-paytpv-container-acount').attr('src'),'_self');
234                    }
235                }
236            },
237            dataType:"json"
238        })
239    }
240
241
242});
243

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.