cfdi

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2019 License: BSD-3-Clause Imports: 4 Imported by: 0

README

gocfdi GoDoc

Package to help validating CFDI invoices with the mexican Tax Administration System.

Install

go get github.com/inkatze/gocfdi

Example

package main

import (
	"fmt"

	"github.com/inkatze/gocfdi"
)

func main() {
	document := cfdi.DocumentHeaders{
		IssuerRFC:    "LSO1306189R5",
		AddresseeRFC: "GACJ940911ASA",
		TotalAmount:  "4999.99",
		InvoiceUUID:  "e7df3047-f8de-425d-b469-37abe5b4dabb",
	}
	result, _ := document.Validate()
	fmt.Printf(result.RawResponse)
}

Documentation

Index

Constants

View Source
const ValidationURL = "https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?wsdl"

ValidationURL for the SOAP service to validate CFDI documents

Variables

This section is empty.

Functions

This section is empty.

Types

type DocumentHeader added in v0.3.0

type DocumentHeader struct {
	IssuerRFC, AddresseeRFC, TotalAmount, InvoiceUUID string
	// contains filtered or unexported fields
}

DocumentHeader values used to uniquely identify CFDI documents

func (*DocumentHeader) Validate added in v0.3.0

func (d *DocumentHeader) Validate() (ValidationResult, error)

Validate checks if the document with the given parameters exists in SAT's system and is valid. BUG(inkatze): The namespace is not being parsed correctly in gosoap, so we have to make two calls to fix the element's namespace

type ValidationResult

type ValidationResult struct {
	RawResponse string
}

ValidationResult contains the processed results from the validation response

Notes

Bugs

  • The namespace is not being parsed correctly in gosoap, so we have to make two calls to fix the element's namespace

Jump to

Keyboard shortcuts

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