How ferreiramg/nfe works
Project type and purpose
• This is a PHP SDK (library) for generating, signing, sending and validating Brazilian electronic invoices (NFe) against SEFAZ web-services.
• There is no UI: it’s a backend tool that transforms invoice data into XML, applies X.509 certificates, performs schema and certificate validation, sends requests over SOAP/HTTP, and processes responses.
File structure
• Top-level:
• conf/ – runtime configuration (API endpoints, certificates store)
• src/ – all production code, organized by concern:
– Certificates/ (Certificate, PrivateKey, PublicKey, interfaces)
– Template/ (TemplateXMLElement)
– Filters/Validates/ (SchemaValidate, ValidateCertificate)
– Request/ (PrepareRequest, ClientStream)
– Service/ (AbstractService, InterfaceService, Status)
– Core classes (Base, SignNFe, DecorateProcess, ProcessTemplate, ProccessInterface)
– Exceptions/ (domain and request errors)
• autoload.php + composer.json – PSR-4 autoloading and dependencies
• test/ – PHPUnit test suites, fixtures, certificate samples
README
• Very minimal: shows how to clone, composer update, set up config in conf/api.conf.public.php, run phpunit.