This document describes the configuration options available for the SEPA Payment Bundle.
- Overview
- Configuration File
- Configuration Options
- How Configuration Works
- Accessing Configuration in Code
- Environment-Specific Configuration
- Validation
- Translations
- Examples
The bundle works out of the box with default settings. No configuration file is required - the bundle uses sensible defaults defined in Configuration.php.
Important: The configuration file (nowo_sepa_payment.yaml) is optional. You only need to create it if you want to customize the default behavior.
Create the configuration file at:
config/packages/nowo_sepa_payment.yaml
nowo_sepa_payment:
default_currency: EUR # Default currency code (ISO 4217)- Type:
string - Default:
EUR - Description: Default currency code for remesas (ISO 4217 format)
- Example:
EUR,USD,GBP
nowo_sepa_payment:
default_currency: EUR- Default Values: The bundle uses default values from
Configuration.phpif no config file exists - YAML Merging: If a YAML file exists, Symfony automatically merges it with default values
- No Auto-Deletion: When uninstalling the bundle, the YAML file is not automatically deleted (you may want to keep your custom configuration)
Configuration values are available as container parameters:
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
class MyService
{
public function __construct(
private ParameterBagInterface $parameterBag
) {
}
public function getDefaultCurrency(): string
{
return $this->parameterBag->get('nowo_sepa_payment.default_currency');
}
}You can override configuration per environment:
# config/packages/dev/nowo_sepa_payment.yaml
nowo_sepa_payment:
default_currency: EUR
# config/packages/prod/nowo_sepa_payment.yaml
nowo_sepa_payment:
default_currency: EURThe bundle validates configuration values:
default_currencymust be a valid ISO 4217 currency code (3 letters)- Invalid values will cause a configuration exception during container compilation
The bundle uses the translation domain NowoSepaPaymentBundle (CamelCase with Bundle suffix). All validation messages and constraint messages (IBAN, BIC, SEPA Creditor Identifier, Credit Card, SEPA Country) are loaded from this domain.
Yes. You can override any message by placing a file with the same domain and locale in your application. Symfony merges catalogues so that your keys take precedence.
Symfony loads translation files in this order:
translations/at the root of your project (configurable viaframework.translator.default_path, usually%kernel.project_dir%/translations).src/Resources/<BundleName>/translations/in your application (if you mirror the bundle structure to override only that bundle).Resources/translations/inside each bundle (this bundle’s messages live here).
So anything you define in your project’s translations/ for the domain NowoSepaPaymentBundle overrides the same keys from the bundle. You only need to define the keys you want to change; the rest fall back to the bundle defaults.
Create YAML (or XLIFF) files in your project’s translations/ directory with the same domain name and locale, for example:
translations/NowoSepaPaymentBundle.es.yaml— overrides Spanish messagestranslations/NowoSepaPaymentBundle.en_US.yaml— overrides US English messages
Keys match the bundle’s structure: validation.* for validation errors (e.g. validation.invalid_iban, validation.missing_required_field) and iban.invalid, bic.invalid, sepa_creditor_identifier.invalid, credit_card.invalid, sepa_country.invalid for constraint messages. Only define the keys you want to override; Symfony will fall back to the bundle’s defaults for the rest.
# config/packages/nowo_sepa_payment.yaml
nowo_sepa_payment:
default_currency: EURIf you need to support multiple currencies, you can still use the default currency for convenience, but you can always specify the currency per transaction:
$transaction = new Transaction(
'E2E-001',
100.50,
'USD', // Currency specified per transaction
'ES9121000418450200051332',
'John Doe'
);