How to convert BIC & IBAN to account and sortcode

百般思念 提交于 2019-12-12 10:38:34

问题


Now that SEPA requirements are getting people used to BIC & IBAN, there are legacy system that cannot cope with this new data. Is there an algorithm or tool available for converting BIC & IBAN back to sort code and account?


回答1:


Here is an example:

from this website.




回答2:


Wikipedia has a list of IBAN formats by country, so it seems at least possible.

However, there is no complete algorithm for it - being a software developer, you can derive an algorithm from that input. Note that other countries might follow in the future, so you can expect more work (and hopefully not more exceptional cases of sort codes and accounts).

Regarding the tool or library, that's off-topic here on StackOverflow, but you might want to ask on Software Recommendations, though. Note that they have different requirements on how to ask questions, so you might want to read the tour first. Don't forget to mention the programming language.




回答3:


Well, a quick search pointed me at this page: http://www.business.hsbc.co.uk/1/2/international-business/iban-bic.

Looks to me like you can just extract appropriate substrings. Although, a bit more searching seems to indicate that the format may vary a bit depending on the country.




回答4:


Both sort code and account number are present inside a United Kingdom or Ireland IBAN. You can simply substring like, PHP Examples:

$iban = "GB04BARC20474473160944";

$sort = substr($iban,8,6);
$account = substr($iban,14,8);


print "SortCode:" . $sort;
print "AccountNumber:" . $account;

The IBAN Calculator webservice has an API which digs up bank and branch information and so on. Also does check digit validation on the iban and sort/account.

But for simple extracting of the sort/account the substring is sufficient.



来源:https://stackoverflow.com/questions/21303708/how-to-convert-bic-iban-to-account-and-sortcode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!