In order to extend payment validation with custom bank’s requirements, one needs to override:
-
DefaultPaymentValidationConfigImpl
with customValidationObject
fields (Occurrence and max length); -
DefaultPaymentBodyFieldsValidatorImpl
with overridden methodcreatePaymentValidationConfig
(put there custom DefaultPaymentValidationConfigImpl extension); -
DefaultPaymentValidatorHolder
with passing custom extendedDefaultPaymentBodyFieldsValidatorImpl
in constructor parameters and overridden methodisCustom
(return true here); -
CustomPaymentValidationService
with annotation@Primary
and override needed methods according to bank’s requirements. UseErrorBuildingService
to enrich message error.