pub struct Account { /* private fields */ }tooling only.Expand description
The account an order is for, as KTI (international: IBAN and BIC) and, where known, KTV (national: number, subaccount, bank code).
The constructors refuse an account the bank could not address: no IBAN
or no BIC for Account::new, no number or no valid bank code for
Account::national. Orders on Dialog<Open> take &Account, so
they never see an empty identifier.
use fints_client::protocol::Account;
let account = Account::new("DE14 1234 5678 0000 0047 11", "TESTDEFFXXX").unwrap();
assert_eq!(account.iban(), "DE14123456780000004711");
assert_eq!(account.account_number(), Some("4711"));
assert!(Account::new("DE14123456780000004711", " ").is_err());Implementations§
Source§impl Account
impl Account
Sourcepub fn new(iban: &str, bic: &str) -> Result<Self>
pub fn new(iban: &str, bic: &str) -> Result<Self>
An account by IBAN and BIC; fails when either is blank.
Blanks are removed from the IBAN and letters upper-cased. A German IBAN contains the bank code (positions 5 to 12) and the account number (13 to 22), which become the KTV that HKSAL 5 and 6, HKKAZ 5 and 6 and HKWPD need.
Sourcepub fn national(
number: &str,
subaccount: Option<&str>,
blz: &Blz,
bic: &str,
) -> Result<Self>
pub fn national( number: &str, subaccount: Option<&str>, blz: &Blz, bic: &str, ) -> Result<Self>
An account by its KTV alone, the way the UPD lists most depots. HKWPD addresses such an account; orders whose segment version needs an IBAN fail for it. National account details exist only in Germany (country code 280), so the bank code must have 8 digits.
Sourcepub fn with_national(
self,
number: &str,
subaccount: Option<&str>,
blz: &Blz,
) -> Self
pub fn with_national( self, number: &str, subaccount: Option<&str>, blz: &Blz, ) -> Self
The same account with this KTV, which replaces anything taken from the IBAN; used with the details the UPD gives.
Sourcepub fn iban(&self) -> &str
pub fn iban(&self) -> &str
The IBAN without blanks; empty for an account known nationally only.
pub fn bic(&self) -> &str
Sourcepub fn account_number(&self) -> Option<&str>
pub fn account_number(&self) -> Option<&str>
The KTV account number, if known.
Sourcepub fn subaccount(&self) -> Option<&str>
pub fn subaccount(&self) -> Option<&str>
The KTV subaccount, if any.