Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var saldoRestante=document.getElementById("js-balance").innerText;//document.getElementById("js-balance").innerHTML
- saldoRestante = parseFloat(saldoRestante.replace(/[^0-9\.]/g, ''))// elimino cualquier cosa que no sea numero o punto
- var html = $('body').html()// trae el html de la pagina
- var valcook = getCookie('curIndex')
- //if(saldoRestante >=200000){
- var referencias = ['1110507641','93365101','65744787'] //CEDULA DANNY,CEDULA DANILO,CEDULA MAGNOLI
- //}else{
- //var referencias = ['4', '1']
- //}
- function setCookie(cname, cvalue, exdays) {//funion para crear la cookie
- var d = new Date();
- d.setTime(d.getTime() + (exdays*24*60*60*1000));
- var expires = "expires="+ d.toUTCString();
- document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
- }
- function getCookie (cname) {//funcion para obtener la cookie
- var name = cname + '='
- var decodedCookie = decodeURIComponent(document.cookie)
- var ca = decodedCookie.split(';')
- for (var i = 0; i < ca.length; i++) {
- var c = ca[i]
- while (c.charAt(0) == ' ') {
- c = c.substring(1)
- }
- if (c.indexOf(name) == 0) {
- return c.substring(name.length, c.length)
- }
- }
- return ''
- }
- function cedula () {
- if (html.indexOf('Error 49: La acción realizada ha presentado un error') >= 0) {
- setTimeout(function () {
- location.href = ('https://tendero.moviired.co/detail-payment/90102')
- }, 500)
- } else {
- if (html.indexOf('Escoge pago total o pago parcial') >= 0) {
- setTimeout(function () {
- $('#pago_parcial').click()
- resaltar()
- dar_formato('2000')
- }, 100)
- setTimeout(function () {
- document.getElementById('form').submit()
- }, 500)
- } else {
- if (valcook === ''|| valcook >= referencias.length) {
- setCookie('curIndex',0)
- valcook = getCookie('curIndex')
- }
- var curRef = referencias[valcook]
- $('#number_reference').val(curRef )
- setTimeout(function () {
- document.getElementById('form').submit()
- }, 500)
- }
- }
- }
- function finalizado () {
- if (html.indexOf('El pago fue exitoso.') >= 0) {
- valcook++
- setCookie('curIndex', valcook)
- setTimeout(function () {
- location.href = ('https://tendero.moviired.co/detail-payment/90102')
- }, 8000)
- } else {
- if (html.indexOf('Error com.mmoney.exception.ApplicationException: 60019: null') >= 0) {
- location.href = ('https://tendero.moviired.co')
- alert('Se le acabo el saldo')
- } else {
- if (html.indexOf('Pago fallido') >= 0) {
- setTimeout(function () {
- //location.href = ('https://tendero.moviired.co/detail-payment/90102')
- alert('SE PRESENTO UN ERROR POR FAVOR VERIFIQUE E INFORME A SU SUPERVISOR')
- location.href = ('https://tendero.moviired.co')
- }, 500)
- } else {
- location.href = ('https://tendero.moviired.co/detail-payment/90102')
- }
- }
- }
- }
- var saldoRestante=document.getElementById("js-balance").innerText;//document.getElementById("js-balance").innerHTML
- saldoRestante = parseFloat(saldoRestante.replace(/[^0-9\.]/g, ''))// elimino cualquier cosa que no sea numero o punto
- if(window.location.pathname===('/detail-payment/90102')){
- cedula()
- }
- else if(window.location.pathname===('/detail-payment/verify-payment')){
- document.getElementById("form").submit();
- //alert('le dio click en continuar')
- }
- else if(window.location.pathname===('/detail-payment/confirm')){
- //if(saldoRestante >2000 || saldoRestante ===('-')|| saldoRestante ===('')){
- finalizado()//}
- //else{
- //saldoRestante=document.getElementById("js-balance").innerText;//document.getElementById("js-balance").innerHTML
- //alert('tu saldo es '+ saldoRestante)
- //location.href = ('https://tendero.moviired.co')
- //}
- }
Add Comment
Please, Sign In to add comment