diff --git a/app/models/champs/iban_champ.rb b/app/models/champs/iban_champ.rb index 9c8b24053..cc26eafa8 100644 --- a/app/models/champs/iban_champ.rb +++ b/app/models/champs/iban_champ.rb @@ -4,14 +4,6 @@ class Champs::IbanChamp < Champ validates_with IbanValidator, if: :validate_champ_value_or_prefill? after_validation :format_iban - def for_api - to_s.gsub(/\s+/, '') - end - - def for_api_v2 - for_api - end - private def format_iban diff --git a/app/models/types_de_champ/iban_type_de_champ.rb b/app/models/types_de_champ/iban_type_de_champ.rb index 4fed46419..a5a683f25 100644 --- a/app/models/types_de_champ/iban_type_de_champ.rb +++ b/app/models/types_de_champ/iban_type_de_champ.rb @@ -4,4 +4,8 @@ class TypesDeChamp::IbanTypeDeChamp < TypesDeChamp::TypeDeChampBase def estimated_fill_duration(revision) FILL_DURATION_MEDIUM end + + def champ_value_for_api(champ, version: 2) + champ_value(champ).gsub(/\s+/, '') + end end