salesking / sepa_king

Ruby gem for creating SEPA XML files
MIT License
149 stars 118 forks source link

SEPA::Error: Account: ["Bic: COBADEFFXXXX is invalid"] #116

Closed klyonrad closed 1 year ago

klyonrad commented 1 year ago

Hey, we are getting this error message:

SEPA::Error: Account: ["Bic: COBADEFFXXXX is invalid"]

when calling SEPA::CreditTransfer#to_xml

However this is a normal BIC from Commerzbank (germany). Double checked with https://www.bundesbank.de/de/aufgaben/unbarer-zahlungsverkehr/serviceangebot/bankleitzahlen/download-bankleitzahlen-602592

Is there any way we can work around this?

klyonrad commented 1 year ago

Sorry, my mistake. The user input has one X too many, making the BIC too long by one character

https://en.wikipedia.org/wiki/ISO_9362#Structure

3 letters or digits: branch code, optional ('XXX' for primary office)