Polosh12

ROBOT INDEPENDIENTE

Jul 31st, 2019
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var saldoRestante=document.getElementById("js-balance").innerText;//document.getElementById("js-balance").innerHTML
  2. saldoRestante = parseFloat(saldoRestante.replace(/[^0-9\.]/g, ''))// elimino cualquier cosa que no sea numero o punto  
  3.  
  4. var html = $('body').html()// trae el html de la pagina
  5. var valcook = getCookie('curIndex')
  6. //if(saldoRestante >=200000){
  7. var referencias = ['1110507641','93365101','65744787'] //CEDULA DANNY,CEDULA DANILO,CEDULA MAGNOLI
  8. //}else{
  9. //var referencias = ['4', '1']
  10. //}
  11.    
  12. function setCookie(cname, cvalue, exdays) {//funion para crear la cookie
  13.   var d = new Date();
  14.   d.setTime(d.getTime() + (exdays*24*60*60*1000));
  15.   var expires = "expires="+ d.toUTCString();
  16.   document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
  17. }
  18.  
  19. function getCookie (cname) {//funcion para obtener la cookie
  20.         var name = cname + '='
  21.         var decodedCookie = decodeURIComponent(document.cookie)
  22.         var ca = decodedCookie.split(';')
  23.         for (var i = 0; i < ca.length; i++) {
  24.             var c = ca[i]
  25.             while (c.charAt(0) == ' ') {
  26.                 c = c.substring(1)
  27.             }
  28.             if (c.indexOf(name) == 0) {
  29.                 return c.substring(name.length, c.length)
  30.             }
  31.         }
  32.         return ''
  33. }
  34.            
  35. function cedula () {    
  36.     if (html.indexOf('Error 49: La acción realizada ha presentado un error') >= 0) {
  37.         setTimeout(function () {
  38.             location.href = ('https://tendero.moviired.co/detail-payment/90102')
  39.         }, 500)
  40.     } else {
  41.         if (html.indexOf('Escoge pago total o pago parcial') >= 0) {
  42.             setTimeout(function () {
  43.                 $('#pago_parcial').click()
  44.                 resaltar()
  45.                 dar_formato('2000')
  46.             }, 100)
  47.             setTimeout(function () {
  48.                 document.getElementById('form').submit()
  49.             }, 500)
  50.  
  51.         } else {
  52.                 if (valcook === ''|| valcook >= referencias.length) {
  53.                 setCookie('curIndex',0)
  54.                 valcook = getCookie('curIndex')            
  55.              }  
  56.              var curRef = referencias[valcook]
  57.             $('#number_reference').val(curRef )
  58.             setTimeout(function () {
  59.                 document.getElementById('form').submit()
  60.             }, 500)
  61.         }
  62.     }
  63. }
  64.  
  65. function finalizado () {
  66.  
  67.    
  68.         if (html.indexOf('El pago fue exitoso.') >= 0) {
  69.             valcook++
  70.             setCookie('curIndex', valcook)
  71.             setTimeout(function () {
  72.                 location.href = ('https://tendero.moviired.co/detail-payment/90102')
  73.             }, 8000)
  74.         } else {
  75.             if (html.indexOf('Error com.mmoney.exception.ApplicationException: 60019: null') >= 0) {
  76.                 location.href = ('https://tendero.moviired.co')
  77.                 alert('Se le acabo el saldo')
  78.             } else {
  79.                 if (html.indexOf('Pago fallido') >= 0) {
  80.                     setTimeout(function () {
  81.                         //location.href = ('https://tendero.moviired.co/detail-payment/90102')
  82.                         alert('SE PRESENTO UN ERROR POR FAVOR VERIFIQUE E INFORME A SU SUPERVISOR')
  83.                         location.href = ('https://tendero.moviired.co')
  84.                     }, 500)
  85.                 } else {
  86.                     location.href = ('https://tendero.moviired.co/detail-payment/90102')
  87.                 }
  88.             }
  89.         }    
  90. }
  91.  var saldoRestante=document.getElementById("js-balance").innerText;//document.getElementById("js-balance").innerHTML
  92. saldoRestante = parseFloat(saldoRestante.replace(/[^0-9\.]/g, ''))// elimino cualquier cosa que no sea numero o punto    
  93. if(window.location.pathname===('/detail-payment/90102')){
  94.      
  95.  
  96. cedula()
  97.  
  98. }
  99. else if(window.location.pathname===('/detail-payment/verify-payment')){
  100.     document.getElementById("form").submit();
  101. //alert('le dio click en continuar')
  102. }
  103. else if(window.location.pathname===('/detail-payment/confirm')){
  104. //if(saldoRestante >2000 || saldoRestante ===('-')|| saldoRestante ===('')){      
  105. finalizado()//}
  106. //else{
  107. //saldoRestante=document.getElementById("js-balance").innerText;//document.getElementById("js-balance").innerHTML
  108. //alert('tu saldo es '+ saldoRestante)
  109.  //location.href = ('https://tendero.moviired.co')
  110. //}
  111. }
Add Comment
Please, Sign In to add comment