Download the PHP package paseto/nfse-betha without Composer
On this page you can find all versions of the php package paseto/nfse-betha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download paseto/nfse-betha
More information about paseto/nfse-betha
Files in paseto/nfse-betha
Package nfse-betha
Short Description PHP library for NFSe Betha integration with XML digital signing support using ICP Brasil certificates
License MIT
Homepage https://github.com/paseto/nfse-betha
Informations about the package nfse-betha
NFSe Betha PHP Library
-
Wrapper for the non working version of NFSe Betha API in PHP. https://iss.ajuda.betha.cloud/e-nota-cloud/ajuda/outros-conteudos/web-service/
- Layout: Abrasf 2.02 with modified wsdl
A comprehensive PHP library for NFSe Betha integration with XML digital signing support using ICP Brasil certificates.
Features
- ๐ Complete XML Digital Signing with ICP Brasil certificates
- ๐ Full NFSe Operations: Generation, Cancellation, and Consultation
- ๐ก๏ธ XML-DSig Compliance following W3C standards
- ๐๏ธ XSD Schema Validation according to nfse_v202.xsd
- ๐ Automatic SOAP Envelope creation and handling
- ๐ Multi-mode Support: SoapClient and cURL fallback
- ๐ Comprehensive Error Handling and validation
- ๐ Local WSDL Support for reliable offline development
- ๐ Production Ready with extensive testing
- ๐ Secure Certificate Handling - accepts certificate content (not file paths)
- ๐ฏ Simplified API - prestador data configured once in constructor
- ๐งน Clean Code - no repetitive prestador arrays in method calls
Requirements
- PHP >= 7.4
- OpenSSL extension
- DOM extension
- XML extension
- cURL extension
- SOAP extension
- ICP Brasil certificate in PFX format
Installation
Install via Composer:
Quick Start
Basic Usage
Cancel NFSe
Consult NFSe
Configuration
Certificate Setup
- Obtain your ICP Brasil certificate in PFX format
- Store it securely (outside web root)
- Set appropriate file permissions (600)
Environment Variables
For enhanced security, use environment variables:
Digital Signing
This library implements complete XML digital signing according to:
- XML-DSig W3C Standards
- ICP Brasil Requirements
- NFSe Betha XSD Schema
Signature Features
- โ Automatic signature placement per XSD schema
- โ Canonical XML (C14N) processing
- โ X509 certificate embedding
- โ SHA1 digest and RSA-SHA1 signature algorithms
- โ Enveloped signature transforms
Available Operations
| Operation | Method | Signing Required |
|---|---|---|
| Generate NFSe | gerarNfse() |
โ Yes |
| Cancel NFSe | cancelarNfse() |
โ Yes |
| Consult NFSe Range | consultarNfseFaixa() |
โ No |
| Consult NFSe by Provider | consultarNfseServicoPrestado() |
โ No |
| Send RPS Batch | enviarLoteRps() |
โ Yes |
| Consult RPS Batch | consultarLoteRps() |
โ No |
Error Handling
Testing
Run the test suite:
Check code quality:
Security
Best Practices
-
Certificate Security
- Store certificates outside web root
- Use environment variables for passwords
- Set proper file permissions (600)
- Never commit certificates to version control
-
Environment Configuration
- Use
.envfiles for sensitive configuration - Validate all input parameters
- Log errors securely without exposing sensitive data
- Use
- Production Deployment
- Use HTTPS in production
- Implement proper error logging
- Monitor certificate expiration
- Regular security updates
Contributing
Contributions are welcome! Please read our Contributing Guide for details.
Development Setup
Code Standards
- PSR-2 coding standards
- PHPStan level 7 analysis
- 100% test coverage for critical paths
Changelog
Please see CHANGELOG for recent changes.
License
The MIT License (MIT). Please see License File for more information.
Support
- ๐ง Email: [email protected]
- ๐ Issues: GitHub Issues
- ๐ Documentation: Wiki
All versions of nfse-betha with dependencies
ext-openssl Version *
ext-dom Version *
ext-xml Version *
ext-curl Version *
ext-soap Version *
ext-libxml Version *