Skip to content

feat(invoice): create invoices after payment completion - #2

Open
LeoMoshko wants to merge 1 commit into
mainfrom
feat/automatic-e-invoice-creation
Open

feat(invoice): create invoices after payment completion#2
LeoMoshko wants to merge 1 commit into
mainfrom
feat/automatic-e-invoice-creation

Conversation

@LeoMoshko

@LeoMoshko LeoMoshko commented Aug 2, 2026

Copy link
Copy Markdown

Automatic e-invoice creation after payment completion

This change implements task 03: automatic e-invoice creation for paid orders.

What was added

  • A Symfony event subscriber listening for the Sylius payment complete workflow transition.

  • Automatic creation and processing of an e-invoice after successful payment.

  • Per-channel configuration using enabled_channels.

  • Idempotency protection:

    • repository check before creating an invoice;
    • unique database constraint ensuring one e-invoice per order.
  • Doctrine migration for the unique order constraint.

  • PHPUnit coverage for enabled channels, disabled channels, duplicate events, and event registration.

  • Behat coverage using the real Sylius payment workflow.

  • Updated README, changelog, architecture documentation, and task status.

Configuration

Automatic creation is disabled by default. Enable it for selected channel codes:

madcoders_sylius_einvoicing:
enabled_channels:
- WEB_US
- WEB_PL

Verification

  • PHPStan: passed
  • ECS: passed
  • PHPUnit: 28 tests, 82 assertions
  • Behat: 6 scenarios, 86 steps
  • Symfony container lint: passed
  • Doctrine mapping validation: passed

@LeoMoshko
LeoMoshko requested a review from plewandowski as a code owner August 2, 2026 22:09
@LeoMoshko LeoMoshko self-assigned this Aug 2, 2026
@LeoMoshko LeoMoshko added the enhancement New feature or request label Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant