balance

package
v0.0.0-...-69338bc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const BALANCE_SELECTOR = ".card-body .align-middle .h5.text-right"
View Source
const BALANCE_URL = BASE_URL + "faces/main.xhtml?formulario=formulario&formulario%%3Atxt_bip=%d&javax.faces.ViewState=%s&javax.faces.source=formulario%%3Abot_consultar_tarjeta&javax.faces.partial.event=click&javax.faces.partial.execute=formulario%%3Abot_consultar_tarjeta%%20formulario&javax.faces.partial.render=formulario&javax.faces.behavior.event=action&javax.faces.partial.ajax=true"
View Source
const BASE_URL = "https://cargatubip.metro.cl/CargaTuBipV2/"
View Source
const VIEWSTATE_SELECTOR = "input[name=\"javax.faces.ViewState\"]"

Variables

View Source
var Errors = map[ErrorCode]string{
	0:  "Saldo obtenido satisfactoriamente",
	10: "Error indeterminado al interpretar parámetro Bip ID",
	11: "Parámetro Bip ID faltante",
	12: "Parámetro Bip ID mal formado",
	20: "Error indeterminado al parsear información desde RedBip",
	21: "RedBip no contesta",
	22: "RedBip contesta, pero no entrega información interpretable",
	23: "Imposible interpretar valor de saldo",
}

Functions

This section is empty.

Types

type ErrorCode

type ErrorCode int

type Parser

type Parser struct {
	ViewRequest *http.Request
	ViewState   string
}

func (*Parser) GetCronTasks

func (p *Parser) GetCronTasks() []*common.CronTask

func (*Parser) GetRoute

func (bp *Parser) GetRoute() string

func (*Parser) Parse

func (bp *Parser) Parse(c *gin.Context)

func (*Parser) StartParser

func (bp *Parser) StartParser()

func (*Parser) StopParser

func (bp *Parser) StopParser()

type Response

type Response struct {
	ID                string    `json:"id"`
	StatusCode        ErrorCode `json:"status_code"`
	StatusDescription string    `json:"status_description"`
	Balance           int       `json:"balance"`
	Error             string    `json:"error,omitempty"`
}

func (*Response) SetStatus

func (br *Response) SetStatus(code ErrorCode)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL