fix(iban): format iban through type_de_champ
This commit is contained in:
parent
02934188b4
commit
1ded040730
2 changed files with 4 additions and 8 deletions
|
@ -4,14 +4,6 @@ class Champs::IbanChamp < Champ
|
||||||
validates_with IbanValidator, if: :validate_champ_value_or_prefill?
|
validates_with IbanValidator, if: :validate_champ_value_or_prefill?
|
||||||
after_validation :format_iban
|
after_validation :format_iban
|
||||||
|
|
||||||
def for_api
|
|
||||||
to_s.gsub(/\s+/, '')
|
|
||||||
end
|
|
||||||
|
|
||||||
def for_api_v2
|
|
||||||
for_api
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def format_iban
|
def format_iban
|
||||||
|
|
|
@ -4,4 +4,8 @@ class TypesDeChamp::IbanTypeDeChamp < TypesDeChamp::TypeDeChampBase
|
||||||
def estimated_fill_duration(revision)
|
def estimated_fill_duration(revision)
|
||||||
FILL_DURATION_MEDIUM
|
FILL_DURATION_MEDIUM
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def champ_value_for_api(champ, version: 2)
|
||||||
|
champ_value(champ).gsub(/\s+/, '')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue