Skip to content

Release v1.1.0

Choose a tag to compare

@github-actions github-actions released this 09 Jan 12:04
· 243 commits to main since this release

Release version 1.1.0: Validation Caching, ParseDirectDebitCommand, and Validation Events

New Features:

  • Validation Caching: Cache validation results for improved performance
  • ParseDirectDebitCommand: Console command for parsing Direct Debit XML files
  • Validation Events: BeforeValidationEvent and AfterValidationEvent for extensibility

Improvements:

  • Added 19 new tests
  • Added demo endpoints for validation caching
  • Updated documentation (CHANGELOG, FUTURE.md)

Total: 323 tests, 1030+ assertions

Changelog

Added

  • Validation Caching: New caching system for validation results to improve performance
    • ValidationCacheInterface and ValidationCache - Service for caching validation results (PSR-16 SimpleCache compatible)
    • CachedIbanValidator - Cached wrapper for IBAN validation
    • CachedBicValidator - Cached wrapper for BIC validation
    • Optional cache adapter support (works without cache, backward compatible)
    • Configurable TTL for cached results
    • Cache key normalization and management
  • Console Command for Direct Debit Parsing: New command to parse SEPA Direct Debit XML files
    • nowo:sepa:parse-direct-debit - Parse and display Direct Debit XML information
    • JSON output option (--json)
    • Displays group header, payment information, and transaction details
    • Validates XML structure before parsing
  • Validation Events: Event system for validation operations
    • BeforeValidationEvent - Dispatched before validation (allows custom validation logic)
    • AfterValidationEvent - Dispatched after validation (for logging and monitoring)
    • Full integration with Symfony EventDispatcher
  • Automatic BIC Lookup by IBAN: New BicLookupService for automatically looking up BIC codes from IBANs
    • BicLookupServiceInterface - Interface for BIC lookup services
    • BicLookupService - Implementation with local database of IBAN to BIC mappings
    • Support for 8 countries: ES (Spain), DE (Germany), FR (France), IT (Italy), GB (UK), NL (Netherlands), BE (Belgium), PT (Portugal)
    • Automatic BIC lookup in CreditTransferGenerator and DirectDebitGenerator when BIC is missing
    • Optional cache support (PSR-16 SimpleCache compatible)
    • lookupBic() - Look up BIC code for a given IBAN
    • isAvailable() - Check if BIC lookup is available for a given IBAN
    • addMapping() - Add custom IBAN to BIC mappings for bank-specific codes
    • Country-specific bank code extraction patterns for accurate BIC lookup
    • Comprehensive local database with common bank mappings
  • Export to Other Formats: New ExportService for exporting SEPA payment data to various formats
    • exportCreditTransferToJson() - Export Credit Transfer data to JSON format (with pretty print option)
    • exportDirectDebitToJson() - Export Direct Debit data to JSON format (with pretty print option)
    • exportCreditTransferToCsv() - Export Credit Transfer data to CSV format (customizable delimiter and enclosure)
    • exportDirectDebitToCsv() - Export Direct Debit data to CSV format (customizable delimiter and enclosure)
    • importCreditTransferFromJson() - Import Credit Transfer data from JSON format
    • importDirectDebitFromJson() - Import Direct Debit data from JSON format
    • Full support for multiple transactions in CSV exports
    • Comprehensive CSV headers for both Credit Transfer and Direct Debit formats
  • Symfony Events: Event system for extensibility without modifying bundle code
    • BeforeCreditTransferGenerationEvent - Dispatched before Credit Transfer XML generation (allows data modification)
    • AfterCreditTransferGenerationEvent - Dispatched after Credit Transfer XML generation (allows XML modification)
    • BeforeDirectDebitGenerationEvent - Dispatched before Direct Debit XML generation (allows data modification)
    • AfterDirectDebitGenerationEvent - Dispatched after Direct Debit XML generation (allows XML modification)
    • Event dispatcher integration in CreditTransferGenerator and DirectDebitGenerator (optional dependency injection)
    • Full support for event listeners and subscribers to modify data and XML
  • Structured Logging: New SepaPaymentLogger service for structured logging of SEPA operations
    • Integration with Psr\Log\LoggerInterface for flexible logging backends
    • Structured logging methods for Credit Transfer and Direct Debit generation (start, success, failure)
    • Structured logging methods for validation events (IBAN, BIC, XSD validation)
    • Structured logging methods for parsing events (Credit Transfer and Direct Debit parsing)
    • Context data included in all log entries (messageId, transactionCount, etc.)
    • Optional logger injection in generators (backward compatible)
    • Automatic logging of generation lifecycle events
  • SEPA String Sanitization: New SepaStringSanitizer service for validating and sanitizing strings according to SEPA character rules
    • Validates allowed characters in SEPA names and addresses
    • Sanitizes invalid characters and replaces accented characters with ASCII equivalents
    • Validates and truncates field lengths (names, addresses, remittance information)
    • Supports maximum length validation for all SEPA fields
  • SEPA Country Validation: New SepaCountryValidator service for validating SEPA member countries
    • Validates if a country code is a SEPA member (34 countries supported)
    • Validates country from IBAN
    • Provides country names for all SEPA member countries
    • Includes all current SEPA members (EU, EEA, Switzerland, UK, Monaco, San Marino)
  • SEPA Business Rules Validation: New SepaBusinessRulesValidator service for validating SEPA business rules and limits
    • Validates transaction amount limits (max: 999,999,999.99 EUR)
    • Validates transaction count limits (max: 99,999 per file)
    • Validates execution date rules (must be today or future)
    • Validates business day rules (Monday to Friday)
    • Validates currency restrictions (EUR only for SEPA)
    • Validates mandate expiration dates
    • Validates sequence type transitions for Direct Debit (FRST → RCUR, etc.)
    • Comprehensive validation methods for Credit Transfer and Direct Debit

Improved

  • Generators:
    • CreditTransferGenerator now auto-fills creditor and debtor BIC when missing (if BicLookupService is injected)
    • DirectDebitGenerator now auto-fills creditor and debtor BIC when missing (if BicLookupService is injected)
    • BIC lookup is optional and backward compatible (only works if service is injected)
  • Demo Applications:
    • Added new demo endpoints for export/import functionality, BIC lookup, string sanitization, country validation, business rules validation, validation caching, and mandate management
    • Added /demo-validation-cache-iban - Demonstrates IBAN validation caching with performance comparison
    • Added /demo-validation-cache-bic - Demonstrates BIC validation caching with performance comparison
    • Added /demo-sepa-string-sanitizer - Demonstrates SEPA string sanitization
    • Added /demo-sepa-country-validator - Demonstrates SEPA country validation
    • Added /demo-sepa-business-rules - Demonstrates SEPA business rules validation
    • Added /demo-mandate-management - Demonstrates mandate creation and management
    • Added /demo-mandate-lifecycle - Demonstrates mandate lifecycle (create, suspend, reactivate, revoke)
    • Added /demo-mandate-sequence-transitions - Demonstrates sequence type transition validation
    • Fixed JsonResponse usage in all demo endpoints (proper encoding options with setEncodingOptions())
    • All demo endpoints now properly format JSON output with pretty print and unicode support
  • Documentation:
    • Updated USAGE.md with comprehensive examples for all new services
    • Updated FUTURE.md to mark Validation Caching and Mandate Management as completed
    • Updated UPGRADE.md with Mandate Management documentation
  • Test Coverage:
    • Added 5 new tests for ValidationCache (ValidationCacheTest.php)
    • Added 4 new tests for CachedIbanValidator (CachedIbanValidatorTest.php)
    • Added 4 new tests for CachedBicValidator (CachedBicValidatorTest.php)
    • Added 4 new tests for ParseDirectDebitCommand (ParseDirectDebitCommandTest.php)
    • Added 2 new tests for validation events (ValidationEventTest.php)
    • Added 12 new tests for MandateService (MandateServiceTest.php)
    • Total: 335+ tests, 1042+ assertions