gawrys/counterparty-bundle

Symfony bundle for counterparty-verification: DI extension, tagged drivers and research tools, validator constraint and Messenger integration.

Maintainers

Package info

github.com/igorgawrys1/counterparty-bundle

Type:symfony-bundle

pkg:composer/gawrys/counterparty-bundle

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.1 2026-06-27 11:46 UTC

This package is auto-updated.

Last update: 2026-06-27 11:47:06 UTC


README

Packagist Version Total Downloads CI PHP Symfony PHPStan Psalm License

The Symfony bundle for the Counterparty Verification toolkit: a DI extension, tagged drivers and research tools, a validator constraint and Messenger integration.

⚠️ A due-diligence aid, not a guarantee of AML compliance. Risk output is advisory.

Features

  • Auto-wired - PSR contracts mapped onto Symfony (Psr18Client, logger, clock); the Verifier is a first-class service.
  • Tagged drivers - tag a service counterparty.registry_driver and a compiler pass collects it into the shared manager (research tools via counterparty.research_tool).
  • Validator - a NotSanctioned constraint + validator for the Validator component.
  • Messenger - a message + handler for asynchronous verification.
  • Config-driven - strategy (rule_based | ai), sanctions provider, registry tokens; conditional AI wiring.

Installation

composer require gawrys/counterparty-bundle
# config/packages/counterparty.yaml
counterparty:
    strategy: rule_based      # or "ai" (requires gawrys/counterparty-ai + an AiResearchProvider)
    sanctions:
        provider: sanctions_network   # or "opensanctions"
    registries:
        ceidg_token: '%env(CEIDG_TOKEN)%'

Usage

public function __construct(private \Gawrys\Counterparty\Verifier $verifier) {}

$outcome = $this->verifier->verify(new \Gawrys\Counterparty\Counterparty('Acme', 'PL', nip: '1234567890'));

Add a registry by tagging a service:

services:
    App\Registry\GermanRegistryDriver:
        tags:
            - { name: counterparty.registry_driver, alias: de }

Validate a property:

use Gawrys\Counterparty\Symfony\Validator\NotSanctioned;

#[NotSanctioned(country: 'PL')]
private string $counterpartyName;

Async via Messenger: dispatch VerifyCounterpartyMessage; VerifyCounterpartyHandler handles it.

Full guide: documentation.

Testing

composer check   # php-cs-fixer + PHPStan max (phpstan-symfony) + Psalm level 1 + PHPUnit

Changelog

See CHANGELOG.md.

Contributing & Security

Pull requests welcome. Report security issues privately - see SECURITY.md.

Credits

License

The MIT License (MIT). See LICENSE.