Documentation ¶
Overview ¶
Package gateways contains the different interfaces to send the TicketBAI documents to.
Index ¶
- Variables
- type Connection
- type EBizkaiaConn
- func (c *EBizkaiaConn) Cancel(ctx context.Context, inv *bill.Invoice, doc *doc.AnulaTicketBAI) error
- func (c *EBizkaiaConn) Fetch(ctx context.Context, nif string, name string, year int, page int, ...) ([]*doc.TicketBAI, error)
- func (c *EBizkaiaConn) Post(ctx context.Context, inv *bill.Invoice, doc *doc.TicketBAI) error
- type Environment
- type List
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConnection = errors.New("connection") ErrInvalidRequest = errors.New("invalid request") ErrDuplicatedRecord = errors.New("duplicated record") )
Standard gateway error responses
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface { // Post sends the complete TicketBAI document to the remote end-point. We assume // the document has been fully prepared and signed. Post(ctx context.Context, inv *bill.Invoice, doc *doc.TicketBAI) error Fetch(ctx context.Context, nif string, name string, year int, page int, head *doc.CabeceraFactura) ([]*doc.TicketBAI, error) Cancel(ctx context.Context, inv *bill.Invoice, doc *doc.AnulaTicketBAI) error }
Connection defines what is expected from a connection to a gateway.
type EBizkaiaConn ¶
type EBizkaiaConn struct {
// contains filtered or unexported fields
}
EBizkaiaConn keeps all the connection details together for the Vizcaya region.
func (*EBizkaiaConn) Cancel ¶ added in v0.15.0
func (c *EBizkaiaConn) Cancel(ctx context.Context, inv *bill.Invoice, doc *doc.AnulaTicketBAI) error
Cancel sends the cancellation request for the TickeBAI invoice to the remote end-point.
type Environment ¶ added in v0.15.0
type Environment string
Environment defines the environment to use for connections
const ( EnvironmentProduction Environment = "production" EnvironmentTesting Environment = "testing" )
Environment to use for connections
type List ¶
type List struct {
// contains filtered or unexported fields
}
List keeps together the list of connections
func New ¶
func New(env Environment, cert *xmldsig.Certificate) (*List, error)
New instantiates a new set of connections using the provided config.
Click to show internal directories.
Click to hide internal directories.