Validate against scheme rulebook
validate_payment_schemeEnforce payment-scheme business rules such as SEPA field lengths, currency, and BIC constraints on validated records. Returns structured violations with remediation guidance.
Instructions
Validate records against a payment-scheme rulebook (e.g. SEPA).
Use this after ``validate_records`` to enforce scheme-specific business
rules (SEPA field lengths, allowed characters, currency/BIC constraints)
that JSON-Schema validation alone does not cover. ``validate_records``
checks structural shape; this checks rulebook compliance for one profile.
Delegates to :func:`pain001.validate_scheme`. Supported profiles:
``sepa-sct``, ``sepa-sdd``, ``sepa-inst``, ``xborder-ct``.
Args:
records: Payment records as a list of flat dicts.
profile: The scheme profile name.
Returns:
``{"profile", "is_valid", "violations": [...]}`` with structured
``violations`` (each with ``rule``, ``severity``, ``field``,
``message``, ``remediation`` keys), or ``{"error": ...}`` for an
unknown profile.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | The payment-scheme rulebook profile to enforce. One of 'sepa-sct', 'sepa-sdd', 'sepa-inst', or 'xborder-ct'. Defaults to 'sepa-sct'. | sepa-sct |
| records | Yes | Payment records as a list of flat dicts (field name → value) to check against the scheme rulebook. |