cfdi

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

README

gocfdi GoDoc Go Report Card

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.InvoiceHeader{
		IssuerRFC:    "LSO1306189R5",
		AddresseeRFC: "GACJ940911ASA",
		TotalAmount:  "4999.99",
		UUID:  "e7df3047-f8de-425d-b469-37abe5b4dabb",
	}
	result, _ := document.Validate()
	fmt.Printf("%+v\n", result)
}

Documentation

Overview

Package cfdi contains a collection of tools to read and manage CFDI documents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvoiceHeader added in v0.5.0

type InvoiceHeader struct {
	IssuerRFC, AddresseeRFC, TotalAmount, UUID string
}

InvoiceHeader contains data used to validate a CFDI document.

func (*InvoiceHeader) Validate added in v0.5.0

func (i *InvoiceHeader) 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
	IsDocumentFound, IsValid, IsCancellable bool
}

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