libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 81b9419c3a46a9e5f8a1d7ce3982ac0e1bb478d1
parent 090b60a46f0545bfd4ecb80ee6c8ba3d880588ab
Author: Antoine A <>
Date:   Fri, 24 Apr 2026 10:37:58 +0200

ebics: add iso20022 codegen

Diffstat:
MCargo.lock | 141+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
MCargo.toml | 4++++
Asrc/bin/iso20022-codegen.rs | 219+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/iso20022/bank_tx_code.rs | 1114+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/iso20022/external_code.rs | 2294+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/iso20022/mod.rs | 21+++++++++++++++++++++
Msrc/lib.rs | 1+
7 files changed, 3780 insertions(+), 14 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -137,6 +137,15 @@ dependencies = [ ] [[package]] +name = "atoi_simd" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad17c7c205c2c28b527b9845eeb91cf1b4d008b438f98ce0e628227a822758e" +dependencies = [ + "debug_unsafe", +] + +[[package]] name = "atomic-waker" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -272,6 +281,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] +name = "calamine" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ae05a4e39297eecf9a994210d27501318c37a9318201f8e11050add82bb6f0" +dependencies = [ + "atoi_simd", + "byteorder", + "codepage", + "encoding_rs", + "fast-float2", + "log", + "quick-xml", + "serde", + "zip 7.2.0", +] + +[[package]] name = "castaway" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -282,9 +308,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.58" +version = "1.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1" +checksum = "b7a4d3ec6524d28a329fc53654bbadc9bdd7b0431f5d65f1a56ffb28a1ee5283" dependencies = [ "find-msvc-tools", "jobserver", @@ -383,6 +409,15 @@ dependencies = [ ] [[package]] +name = "codepage" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48f68d061bc2828ae826206326e61251aca94c1e4a5305cf52d9138639c918b4" +dependencies = [ + "encoding_rs", +] + +[[package]] name = "colorchoice" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -519,6 +554,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] name = "crossbeam-queue" version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -626,6 +670,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" [[package]] +name = "debug_unsafe" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eed2c4702fa172d1ce21078faa7c5203e69f5394d48cc436d25928394a867a2" + +[[package]] name = "der" version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -782,10 +832,16 @@ dependencies = [ ] [[package]] +name = "fast-float2" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8eb564c5c7423d25c886fb561d1e4ee69f72354d16918afa32c08811f6b6a55" + +[[package]] name = "fastrand" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" [[package]] name = "fd-lock" @@ -1319,9 +1375,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.13.0" +version = "2.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +checksum = "45a8a2b9cb3e0b0c1803dbb0758ffac5de2f425b23c28f518faabd9d805342ff" dependencies = [ "equivalent", "hashbrown 0.16.1", @@ -1516,6 +1572,7 @@ dependencies = [ "anyhow", "aws-lc-rs", "base64", + "calamine", "clap", "compact_str", "const_format", @@ -1544,6 +1601,7 @@ dependencies = [ "url", "uuid", "x509-parser", + "zip 8.5.1", ] [[package]] @@ -1940,6 +1998,16 @@ dependencies = [ ] [[package]] +name = "quick-xml" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958f21e8e7ceb5a1aa7fa87fab28e7c75976e0bfe7e23ff069e0a260f894067d" +dependencies = [ + "encoding_rs", + "memchr", +] + +[[package]] name = "quinn" version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2428,9 +2496,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" @@ -3173,9 +3241,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.50.0" +version = "1.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" +checksum = "2bd1c4c0fc4a7ab90fc15ef6daaa3ec3b893f004f915f2392557ed23237820cd" dependencies = [ "bytes", "libc", @@ -3189,9 +3257,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c55a2eff8b69ce66c84f85e1da1c233edc36ceb85a2058d11b0d6a3c7e7569c" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", @@ -3343,6 +3411,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] +name = "typed-path" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e28f89b80c87b8fb0cf04ab448d5dd0dd0ade2f8891bae878de66a75a28600e" + +[[package]] name = "typenum" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4158,9 +4232,9 @@ dependencies = [ [[package]] name = "writeable" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" [[package]] name = "x509-parser" @@ -4293,6 +4367,33 @@ dependencies = [ ] [[package]] +name = "zip" +version = "7.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42e33efc22a0650c311c2ef19115ce232583abbe80850bc8b66509ebef02de0" +dependencies = [ + "crc32fast", + "flate2", + "indexmap", + "memchr", + "typed-path", + "zopfli", +] + +[[package]] +name = "zip" +version = "8.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcab981e19633ebcf0b001ddd37dd802996098bc1864f90b7c5d970ce76c1d59" +dependencies = [ + "crc32fast", + "flate2", + "indexmap", + "memchr", + "typed-path", +] + +[[package]] name = "zlib-rs" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4303,3 +4404,15 @@ name = "zmij" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" + +[[package]] +name = "zopfli" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05cd8797d63865425ff89b5c4a48804f35ba0ce8d125800027ad6017d2b5249" +dependencies = [ + "bumpalo", + "crc32fast", + "log", + "simd-adler32", +] diff --git a/Cargo.toml b/Cargo.toml @@ -47,3 +47,7 @@ compact_str = { version = "0.9.0", features = ["serde", "sqlx-postgres"] } uuid = { version = "1.0", features = ["v4", "fast-rng"] } regex = "*" const_format = { version = "0.2", features = ["rust_1_83"] } +zip = { version = "*", default-features = false, features = [ + "deflate-flate2-zlib-rs", +] } +calamine = "*" diff --git a/src/bin/iso20022-codegen.rs b/src/bin/iso20022-codegen.rs @@ -0,0 +1,219 @@ +/* +* This file is part of LibEuFin. +* Copyright (C) 2026 Taler Systems S.A. + +* LibEuFin is free software; you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License as +* published by the Free Software Foundation; either version 3, or +* (at your option) any later version. + +* LibEuFin is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General +* Public License for more details. + +* You should have received a copy of the GNU Affero General Public +* License along with LibEuFin; see the file COPYING. If not, see +* <http://www.gnu.org/licenses/> +*/ + +use std::{ + collections::BTreeMap, + fmt::Write as _, + io::{Cursor, Read as _}, +}; + +use calamine::{DataType, Reader as _, Xlsx}; +use reqwest::StatusCode; +use tokio::join; +use zip::ZipArchive; + +pub async fn iso20022codegen_external_code_set() { + let res = reqwest::get( + "https://www.iso20022.org/sites/default/files/media/file/ExternalCodeSets_XLSX.zip", + ) + .await + .unwrap(); + + assert_eq!(res.status(), StatusCode::OK); + let zipped = res.bytes().await.unwrap(); + let mut zip = ZipArchive::new(Cursor::new(&zipped)).unwrap(); + assert_eq!(zip.len(), 1); + + let mut bytes = Vec::new(); + zip.by_index(0).unwrap().read_to_end(&mut bytes).unwrap(); + let mut excel: Xlsx<_> = calamine::open_workbook_from_rs(Cursor::new(&bytes)).unwrap(); + + let mut code_sets: BTreeMap<_, Vec<_>> = BTreeMap::new(); + + let range = excel.worksheet_range("AllCodeSets").unwrap(); + for row in range.rows() { + let set = row[0].as_string().unwrap(); + let code = row[1].as_string().unwrap(); + let name = row[2].as_string().unwrap().replace('-', ""); + let definition = row[3] + .as_string() + .unwrap() + .split(['.', '\n']) + .next() + .unwrap() + .trim() + .replace("_x000D_", ""); + let vec = code_sets.entry(set).or_default(); + vec.push((code, name, definition)) + } + + let mut out = " +/* + * This file is part of LibEuFin. + * Copyright (C) 2026 Taler Systems S.A. + + * LibEuFin is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation; either version 3, or + * (at your option) any later version. + + * LibEuFin is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General + * Public License for more details. + + * You should have received a copy of the GNU Affero General Public + * License along with LibEuFin; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/> + */ + +// THIS FILE IS GENERATED, DO NOT EDIT + +use strum_macros::{AsRefStr, Display, EnumString}; + " + .to_string(); + + for (set, enum_name) in [ + ("ExternalStatusReason1Code", "ExternalStatusReasonCode"), + ( + "ExternalPaymentGroupStatus1Code", + "ExternalPaymentGroupStatusCode", + ), + ( + "ExternalPaymentTransactionStatus1Code", + "ExternalPaymentTransactionStatusCode", + ), + ("ExternalReturnReason1Code", "ExternalReturnReasonCode"), + ] { + let set = code_sets.get_mut(set).unwrap(); + set.sort_unstable_by_key(|(code, _, _)| code.clone()); + writeln!( + &mut out, + " + #[derive(Debug, Clone, Copy, PartialEq, Eq, EnumString, AsRefStr, Display)] + pub enum {enum_name} {{ + " + ) + .unwrap(); + for (code, name, description) in set.iter() { + writeln!(&mut out, "/// {description}").unwrap(); + writeln!(&mut out, "#[strum(serialize = \"{code}\")]").unwrap(); + writeln!(&mut out, "{name},").unwrap(); + } + writeln!(&mut out, "}}\nimpl {enum_name} {{\n").unwrap(); + writeln!(&mut out, "pub fn description(&self) -> &'static str {{").unwrap(); + writeln!(&mut out, "match self {{").unwrap(); + for (_, name, description) in set { + writeln!(&mut out, "Self::{name} => \"{description}\",").unwrap(); + } + writeln!(&mut out, "}}}}}}\n").unwrap(); + } + std::fs::write("src/iso20022/external_code.rs", out).unwrap(); +} + +pub async fn iso20022codegen_bank_transaction_code() { + let res = reqwest::get( + "https://www.iso20022.org/sites/default/files/media/file/BTC_Codification_21March2024.xlsx", + ) + .await + .unwrap(); + + assert_eq!(res.status(), StatusCode::OK); + let bytes = res.bytes().await.unwrap(); + let mut excel: Xlsx<_> = calamine::open_workbook_from_rs(Cursor::new(&bytes)).unwrap(); + + let mut domain = BTreeMap::new(); + let mut family = BTreeMap::new(); + let mut subfamily = BTreeMap::new(); + + let range = excel.worksheet_range("BTC_Codification").unwrap(); + + for row in range.rows().skip(3) { + for (i, set) in [&mut domain, &mut family, &mut subfamily] + .into_iter() + .enumerate() + { + let name = row[i].as_string().unwrap(); + let code = row[i + 3].as_string().unwrap(); + let code = code.trim().to_string(); + set.insert(code, name); + } + } + + let mut out = " +/* + * This file is part of LibEuFin. + * Copyright (C) 2026 Taler Systems S.A. + + * LibEuFin is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation; either version 3, or + * (at your option) any later version. + + * LibEuFin is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General + * Public License for more details. + + * You should have received a copy of the GNU Affero General Public + * License along with LibEuFin; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/> + */ + +// THIS FILE IS GENERATED, DO NOT EDIT + +use strum_macros::{AsRefStr, Display, EnumString}; + " + .to_string(); + + for (set, enum_name) in [ + (domain, "BankTxDomainCode"), + (family, "BankTxFamilyCode"), + (subfamily, "BankTxSubFamilyCode"), + ] { + writeln!( + &mut out, + " + #[derive(Debug, Clone, Copy, PartialEq, Eq, EnumString, AsRefStr, Display)] + pub enum {enum_name} {{ + " + ) + .unwrap(); + for (code, description) in set.iter() { + writeln!(&mut out, "/// {description}").unwrap(); + writeln!(&mut out, "{code},").unwrap(); + } + writeln!(&mut out, "}}\nimpl {enum_name} {{\n").unwrap(); + writeln!(&mut out, "pub fn description(&self) -> &'static str {{").unwrap(); + writeln!(&mut out, "match self {{").unwrap(); + for (code, description) in set.iter() { + writeln!(&mut out, "Self::{code} => \"{description}\",").unwrap(); + } + writeln!(&mut out, "}}}}}}\n").unwrap(); + } + std::fs::write("src/iso20022/bank_tx_code.rs", out).unwrap(); +} + +#[tokio::main] +pub async fn main() { + join!( + iso20022codegen_external_code_set(), + iso20022codegen_bank_transaction_code() + ); +} diff --git a/src/iso20022/bank_tx_code.rs b/src/iso20022/bank_tx_code.rs @@ -0,0 +1,1114 @@ +/* +* This file is part of LibEuFin. +* Copyright (C) 2026 Taler Systems S.A. + +* LibEuFin is free software; you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License as +* published by the Free Software Foundation; either version 3, or +* (at your option) any later version. + +* LibEuFin is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General +* Public License for more details. + +* You should have received a copy of the GNU Affero General Public +* License along with LibEuFin; see the file COPYING. If not, see +* <http://www.gnu.org/licenses/> +*/ + +// THIS FILE IS GENERATED, DO NOT EDIT + +use strum_macros::{AsRefStr, Display, EnumString}; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumString, AsRefStr, Display)] +pub enum BankTxDomainCode { + /// Account Management + ACMT, + /// Cash Management + CAMT, + /// Commodities + CMDT, + /// Derivatives + DERV, + /// Foreign Exchange + FORX, + /// Loans, Deposits & Syndications + LDAS, + /// Precious Metal + PMET, + /// Payments + PMNT, + /// Securities + SECU, + /// Trade Services + TRAD, + /// Extended Domain + XTND, +} +impl BankTxDomainCode { + pub fn description(&self) -> &'static str { + match self { + Self::ACMT => "Account Management", + Self::CAMT => "Cash Management", + Self::CMDT => "Commodities", + Self::DERV => "Derivatives", + Self::FORX => "Foreign Exchange", + Self::LDAS => "Loans, Deposits & Syndications", + Self::PMET => "Precious Metal", + Self::PMNT => "Payments", + Self::SECU => "Securities", + Self::TRAD => "Trade Services", + Self::XTND => "Extended Domain", + } + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumString, AsRefStr, Display)] +pub enum BankTxFamilyCode { + /// Account Balancing + ACCB, + /// Additional Miscellaneous Credit Operations + ACOP, + /// Additional Miscellaneous Debit Operations + ADOP, + /// Blocked Transactions + BLOC, + /// Cash Pooling + CAPL, + /// Miscellaneous Securities Operations + CASH, + /// Customer Card Transactions + CCRD, + /// Clean Collection + CLNC, + /// Counter Transactions + CNTR, + /// Custody Collection + COLC, + /// Collateral Management + COLL, + /// Corporate Action + CORP, + /// Consumer Loans + CSLN, + /// Custody + CUST, + /// Documentary Credit + DCCT, + /// Delivery + DLVR, + /// Documentary Collection + DOCC, + /// Drafts + DRFT, + /// Fixed Term Deposits + FTDP, + /// Fixed Term Loans + FTLN, + /// Futures + FTUR, + /// Forwards + FWRD, + /// Guarantees + GUAR, + /// Issued Cash Concentration Transactions + ICCN, + /// Issued Credit Transfers + ICDT, + /// Issued Cheques + ICHQ, + /// Issued Direct Debits + IDDT, + /// Issued Real-Time Credit Transfers + IRCT, + /// Lack + LACK, + /// Lockbox Transactions + LBOX, + /// Listed Derivatives - Futures + LFUT, + /// Stand-By Letter Of Credit + LOCT, + /// Listed Derivatives - Options + LOPT, + /// Miscellaneous Credit Operations + MCOP, + /// Merchant Card Transactions + MCRD, + /// Miscellaneous Debit Operations + MDOP, + /// Mortgage Loans + MGLN, + /// Non Deliverable + NDFX, + /// Non Settled + NSET, + /// Not Available + NTAV, + /// Notice Deposits + NTDP, + /// Notice Loans + NTLN, + /// OTC Derivatives - Bonds + OBND, + /// OTC Derivatives - Credit + OCRD, + /// OTC Derivatives - Equity + OEQT, + /// OTC Derivatives - Interest Rates + OIRT, + /// Opening & Closing + OPCL, + /// Options + OPTN, + /// OTC Derivatives - Structured Exotic Derivatives + OSED, + /// OTC Derivatives – Swaps + OSWP, + /// CSD Blocked transactions + OTHB, + /// Other + OTHR, + /// Received Cash Concentration Transactions + RCCN, + /// Received Credit Transfers + RCDT, + /// Received Cheques + RCHQ, + /// Received Direct Debits + RDDT, + /// Received Real-Time Credit Transfers + RRCT, + /// Trade, Clearing and Settlement + SETT, + /// Spots + SPOT, + /// Swaps + SWAP, + /// Syndications + SYDN, +} +impl BankTxFamilyCode { + pub fn description(&self) -> &'static str { + match self { + Self::ACCB => "Account Balancing", + Self::ACOP => "Additional Miscellaneous Credit Operations", + Self::ADOP => "Additional Miscellaneous Debit Operations", + Self::BLOC => "Blocked Transactions", + Self::CAPL => "Cash Pooling", + Self::CASH => "Miscellaneous Securities Operations", + Self::CCRD => "Customer Card Transactions", + Self::CLNC => "Clean Collection", + Self::CNTR => "Counter Transactions", + Self::COLC => "Custody Collection", + Self::COLL => "Collateral Management", + Self::CORP => "Corporate Action", + Self::CSLN => "Consumer Loans", + Self::CUST => "Custody", + Self::DCCT => "Documentary Credit", + Self::DLVR => "Delivery", + Self::DOCC => "Documentary Collection", + Self::DRFT => "Drafts", + Self::FTDP => "Fixed Term Deposits", + Self::FTLN => "Fixed Term Loans", + Self::FTUR => "Futures", + Self::FWRD => "Forwards", + Self::GUAR => "Guarantees", + Self::ICCN => "Issued Cash Concentration Transactions", + Self::ICDT => "Issued Credit Transfers", + Self::ICHQ => "Issued Cheques", + Self::IDDT => "Issued Direct Debits", + Self::IRCT => "Issued Real-Time Credit Transfers", + Self::LACK => "Lack", + Self::LBOX => "Lockbox Transactions", + Self::LFUT => "Listed Derivatives - Futures", + Self::LOCT => "Stand-By Letter Of Credit", + Self::LOPT => "Listed Derivatives - Options", + Self::MCOP => "Miscellaneous Credit Operations", + Self::MCRD => "Merchant Card Transactions", + Self::MDOP => "Miscellaneous Debit Operations", + Self::MGLN => "Mortgage Loans", + Self::NDFX => "Non Deliverable", + Self::NSET => "Non Settled", + Self::NTAV => "Not Available", + Self::NTDP => "Notice Deposits", + Self::NTLN => "Notice Loans", + Self::OBND => "OTC Derivatives - Bonds", + Self::OCRD => "OTC Derivatives - Credit", + Self::OEQT => "OTC Derivatives - Equity", + Self::OIRT => "OTC Derivatives - Interest Rates", + Self::OPCL => "Opening & Closing", + Self::OPTN => "Options", + Self::OSED => "OTC Derivatives - Structured Exotic Derivatives", + Self::OSWP => "OTC Derivatives – Swaps", + Self::OTHB => "CSD Blocked transactions", + Self::OTHR => "Other", + Self::RCCN => "Received Cash Concentration Transactions", + Self::RCDT => "Received Credit Transfers", + Self::RCHQ => "Received Cheques", + Self::RDDT => "Received Direct Debits", + Self::RRCT => "Received Real-Time Credit Transfers", + Self::SETT => "Trade, Clearing and Settlement", + Self::SPOT => "Spots", + Self::SWAP => "Swaps", + Self::SYDN => "Syndications", + } + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumString, AsRefStr, Display)] +pub enum BankTxSubFamilyCode { + /// Account Closing + ACCC, + /// Account Opening + ACCO, + /// Account Transfer + ACCT, + /// ACH Credit + ACDT, + /// ACH Concentration + ACON, + /// ACH Corporate Trade + ACOR, + /// ACH Debit + ADBT, + /// Adjustments (Generic) + ADJT, + /// ACH Pre-Authorised + APAC, + /// ACH Return + ARET, + /// ACH Reversal + AREV, + /// ARP Debit + ARPD, + /// ACH Settlement + ASET, + /// ACH Transaction + ATXN, + /// Automatic Transfer + AUTT, + /// Branch Account Transfer + BACT, + /// SEPA B2B Direct Debit + BBDD, + /// Branch Deposit + BCDP, + /// Bank Cheque + BCHQ, + /// Back Value + BCKV, + /// Branch Withdrawl + BCWD, + /// Bond Forward + BFWD, + /// Repurchase offer/Issuer Bid/Reverse Rights + BIDS, + /// Bank Fees + BKFE, + /// Bonus Issue/Capitalisation Issue + BONU, + /// Internal Book Transfer + BOOK, + /// Put Redemption + BPUT, + /// Brokerage Fee + BROK, + /// Sell Buy Back + BSBC, + /// Buy Sell Back + BSBO, + /// Credit Adjustments (Generic) + CAJT, + /// Capital Gains Distribution + CAPG, + /// Cash Letter + CASH, + /// Certified Customer Cheque + CCCH, + /// Cheque + CCHQ, + /// Cross Currency IRS + CCIR, + /// CCP Cleared Initial Margin + CCPC, + /// CCP Cleared Variation Margin + CCPM, + /// CCP Cleared Segregated Initial Margin + CCSM, + /// Controlled Disbursement + CDIS, + /// Cash Deposit + CDPT, + /// Charge/Fees + CHAR, + /// Check Deposit + CHKD, + /// Charges (Generic) + CHRG, + /// Compensation/Claims + CLAI, + /// Circular Cheque + CLCQ, + /// Corporate Mark Broker Owned + CMBO, + /// Corporate Mark Client Owned + CMCO, + /// Corporate Own Account Transfer + COAT, + /// Commission Excluding Taxes (Generic) + COME, + /// Commission Including Taxes (Generic) + COMI, + /// Commission (Generic) + COMM, + /// Non Taxable Commissions (Generic) + COMT, + /// Conversion + CONV, + /// Cover Transaction + COVE, + /// Cash Penalties + CPEN, + /// Corporate Rebate + CPRB, + /// Cheque Reversal + CQRV, + /// Crossed Cheque + CRCQ, + /// Credit DefaultSwap + CRDS, + /// Cross Trade + CROS, + /// Cross Product + CRPR, + /// Credit Support + CRSP, + /// Credit Line + CRTL, + /// Cash Letter Adjustment + CSHA, + /// Cash In Lieu + CSLI, + /// Cash Withdrawal + CWDL, + /// Debit Adjustments (Generic) + DAJT, + /// Discounted Draft + DDFT, + /// Drawdown + DDWN, + /// Decrease in Value + DECR, + /// Draft Maturity Change + DMCG, + /// Domestic Credit Transfer + DMCT, + /// Deposit + DPST, + /// Drawing + DRAW, + /// Dividend Reinvestment + DRIP, + /// Controlled Disbursement + DSBR, + /// Dutch Auction + DTCH, + /// Cash Dividend + DVCA, + /// Dividend Option + DVOP, + /// Nordic Payment Council Credit Transfer + ENCT, + /// Equity Mark Broker Owned + EQBO, + /// Equity Mark Client Owned + EQCO, + /// Equity Option + EQPT, + /// Equity Swap + EQUS, + /// Exchange Rate Adjustment + ERTA, + /// Lending Income + ERWA, + /// Borrowing Fee + ERWI, + /// SEPA Credit Transfer + ESCT, + /// SEPA Core Direct Debit + ESDD, + /// Exchange + EXOF, + /// Exotic Option + EXPT, + /// Call On Intermediate Securities + EXRI, + /// Exchange Traded Derivatives + EXTD, + /// Warrant Exercise/Warrant Conversion + EXWA, + /// Foreign Currencies Deposit + FCDP, + /// Factor Update + FCTA, + /// Foreign Currencies Withdrawal + FCWD, + /// Fees (Generic) + FEES, + /// Financial Institution Credit Transfer + FICT, + /// Financial Institution Direct Debit Payment + FIDD, + /// Financial Institution Own Account Transfer + FIOA, + /// Fixed Income + FIXI, + /// Float Adjustment + FLTA, + /// Freeze Of Funds + FRZF, + /// Futures Commission + FUCO, + /// Future Variation Margin + FUTU, + /// Forwards Broker Owned Collateral + FWBC, + /// Forwards Client Owned Collateral + FWCC, + /// MFA Segregated Broker Cash Collateral + FWSB, + /// MFA Segregated Client Cash Collateral + FWSC, + /// Withdrawal/Distribution + GEN1, + /// Deposit/Contribution + GEN2, + /// Invoice Accepted with Differed Due Date + IADD, + /// Intra Company Transfer + ICCT, + /// Fixed Deposit Interest Amount + INFD, + /// Inspeci/Share Exchange + INSP, + /// Interests (Generic) + INTR, + /// Depositary Receipt Issue + ISSU, + /// Credit Adjustment + LBCA, + /// Debit + LBDB, + /// Deposit + LBDP, + /// Liquidation Dividend / Liquidation Payment + LIQU, + /// Margin Payments + MARG, + /// Mortgage Back Segregated Broker Cash Collateral + MBSB, + /// Mortgage Back Segregated Client Cash Collateral + MBSC, + /// Full Call / Early Redemption + MCAL, + /// Margin Client Owned Cash Collateral + MGCC, + /// Initial Futures Margin Segregated Client Cash Collateral + MGSC, + /// Mixed Deposit + MIXD, + /// Management Fees + MNFE, + /// Merger + MRGR, + /// Miscellaneous Deposit + MSCD, + /// Netting + NETT, + /// Non Presented Circular Cheques + NPCC, + /// Non Syndicated + NSYN, + /// Not Available + NTAV, + /// New issue distribution + NWID, + /// Client owned OCC pledged collateral + OCCC, + /// Overdraft + ODFT, + /// Odd Lot Sale/Purchase + ODLT, + /// One-Off Direct Debit + OODD, + /// Option Broker Owned Collateral + OPBC, + /// Option Client Owned Collateral + OPCC, + /// Open Cheque + OPCQ, + /// OTC Option Segregated Broker Cash Collateral + OPSB, + /// OTC Option Segregated Client Cash Collateral + OPSC, + /// FX Option + OPTN, + /// Order Cheque + ORCQ, + /// OTC CCP + OTCC, + /// OTC Derivatives + OTCD, + /// OTC + OTCG, + /// OTC Non-CCP + OTCN, + /// Other + OTHR, + /// Overdraft Charge + OVCH, + /// External Account Transfer + OWNE, + /// Internal Account Transfer + OWNI, + /// Pre-Authorised Direct Debit + PADD, + /// Pair-Off + PAIR, + /// Partial Redemption with reduction of nominal value + PCAL, + /// Placement + PLAC, + /// Direct Debit + PMDD, + /// Portfolio Move + PORT, + /// Credit Card Payment + POSC, + /// Point-of-Sale (POS) Payment - Debit Card + POSD, + /// Point-of-Sale (POS) Payment + POSP, + /// Principal Payment + PPAY, + /// Priority Credit Transfer + PRCT, + /// Reversal Due To Payment Reversal + PRDD, + /// Partial Redemption Without Reduction of Nominal Value + PRED, + /// Interest Payment with Principles + PRII, + /// Interest Payment with Principles + PRIN, + /// Priority Issue + PRIO, + /// Principal Pay-Down/Pay-Up + PRUD, + /// Posting Error + PSTE, + /// Reversal Due To Payment Cancellation Request + RCDD, + /// Reversal due to a Cover Transaction Return + RCOV, + /// Redemption Asset Allocation + REAA, + /// Redemption + REDM, + /// Repo + REPU, + /// Futures Residual Amount + RESI, + /// Rights Issue/Subscription Rights/Rights Offer + RHTS, + /// Reimbursement (Generic) + RIMB, + /// Renewal + RNEW, + /// Bi-lateral repo broker owned collateral + RPBC, + /// Repo client owned collateral + RPCC, + /// Reversal Due To Payment Cancellation Request + RPCR, + /// Repayment + RPMT, + /// Bi-lateral Repo Segregated Broker Cash Collateral + RPSB, + /// Bi-lateral Repo Segregated Client Cash Collateral + RPSC, + /// Reversal Due To Payment Return + RRTN, + /// Reverse Repo + RVPO, + /// Redemption Withdrawing Plan + RWPL, + /// Settlement Against Bank Guarantee + SABG, + /// Payroll/Salary Payment + SALA, + /// Securities Buy Sell Sell Buy Back + SBSC, + /// Single Currency IRS Exotic + SCIE, + /// Single Currency IRS + SCIR, + /// Securities Cross Products + SCRP, + /// Same Day Value Credit Transfer + SDVA, + /// Securities Borrowing + SECB, + /// Securities Lending + SECL, + /// Broker owned collateral Short Sale + SHBC, + /// Client owned collateral Short Sale + SHCC, + /// Equity Premium Reserve + SHPR, + /// Short Sell + SHSL, + /// Lending Broker Owned Cash Collateral + SLBC, + /// Lending Client Owned Cash Collateral + SLCC, + /// Securities Lending And Borrowing + SLEB, + /// SecuredLoan + SLOA, + /// Smart-Card Payment + SMCD, + /// Smart-Card Payment + SMRT, + /// Settlement Of Sight Export Document + SOSE, + /// Settlement Of Sight Import Document + SOSI, + /// Subscription Savings Plan + SSPL, + /// Settlement After Collection + STAC, + /// Stamp Duty + STAM, + /// Standing Order + STDO, + /// Settlement + STLM, + /// Settlement Under Reserve + STLR, + /// Bill of Exchange Settlement on Demand + STOD, + /// Subscription Asset Allocation + SUAA, + /// Subscription + SUBS, + /// Swap Payment + SWAP, + /// Swap Broker Owned Collateral + SWBC, + /// Swap Client Owned Cash Collateral + SWCC, + /// Sweep + SWEP, + /// Final Payment + SWFP, + /// Switch + SWIC, + /// Partial Payment + SWPP, + /// Swaption + SWPT, + /// Reset Payment + SWRS, + /// ISDA/CSA Segregated Broker Cash Collateral + SWSB, + /// ISDA/CSA Segregated Client Cash Collateral + SWSC, + /// Upfront Payment + SWUF, + /// Syndicated + SYND, + /// Taxes (Generic) + TAXE, + /// TBA Closing + TBAC, + /// To Be Announced + TBAS, + /// TBA Broker owned cash collateral + TBBC, + /// TBA Client owned cash collateral + TBCC, + /// Travellers Cheques Deposit + TCDP, + /// Travellers Cheques Withdrawal + TCWD, + /// Tender + TEND, + /// Topping + TOPG, + /// Transfer Out + TOUT, + /// Trade + TRAD, + /// Treasury Cross Product + TRCP, + /// Tax Reclaim + TREC, + /// Transaction Fees + TRFE, + /// Transfer In + TRIN, + /// Triparty Repo + TRPO, + /// Triparty Reverse Repo + TRVO, + /// Treasury Tax And Loan Service + TTLS, + /// Turnaround + TURN, + /// Dishonoured/Unpaid Draft + UDFT, + /// Underwriting Commission + UNCO, + /// Unpaid Cheque + UPCQ, + /// Unpaid Card Transaction + UPCT, + /// Reversal Due To Return/Unpaid Direct Debit + UPDD, + /// Cheque Under Reserve + URCQ, + /// Direct Debit Under Reserve + URDD, + /// Value Date + VALD, + /// Credit Transfer With Agreed Commercial Information + VCOM, + /// Withholding Tax + WITH, + /// Cross-Border Credit Card Payment + XBCP, + /// Foreign Cheque + XBCQ, + /// Cross-Border Credit Transfer + XBCT, + /// Cross-Border Cash Withdrawal + XBCW, + /// Cross-Border Direct Debit + XBDD, + /// Cross-Border + XBRD, + /// Cross-Border Payroll/Salary Payment + XBSA, + /// Cross-Border Standing Order + XBST, + /// Exchange Traded CCP + XCHC, + /// Exchange Traded + XCHG, + /// Exchange Traded Non-CCP + XCHN, + /// Cross-Border Intra Company Transfer + XICT, + /// Unpaid Foreign Cheque + XPCQ, + /// Foreign Cheque Under Reserve + XRCQ, + /// Cross Border Reversal Due to Payment Return + XRTN, + /// YTD Adjustment + YTDA, + /// Zero Balancing + ZABA, +} +impl BankTxSubFamilyCode { + pub fn description(&self) -> &'static str { + match self { + Self::ACCC => "Account Closing", + Self::ACCO => "Account Opening", + Self::ACCT => "Account Transfer", + Self::ACDT => "ACH Credit", + Self::ACON => "ACH Concentration", + Self::ACOR => "ACH Corporate Trade", + Self::ADBT => "ACH Debit", + Self::ADJT => "Adjustments (Generic)", + Self::APAC => "ACH Pre-Authorised", + Self::ARET => "ACH Return", + Self::AREV => "ACH Reversal", + Self::ARPD => "ARP Debit", + Self::ASET => "ACH Settlement", + Self::ATXN => "ACH Transaction", + Self::AUTT => "Automatic Transfer", + Self::BACT => "Branch Account Transfer", + Self::BBDD => "SEPA B2B Direct Debit", + Self::BCDP => "Branch Deposit", + Self::BCHQ => "Bank Cheque ", + Self::BCKV => "Back Value", + Self::BCWD => "Branch Withdrawl", + Self::BFWD => "Bond Forward", + Self::BIDS => "Repurchase offer/Issuer Bid/Reverse Rights", + Self::BKFE => "Bank Fees", + Self::BONU => "Bonus Issue/Capitalisation Issue", + Self::BOOK => "Internal Book Transfer", + Self::BPUT => "Put Redemption", + Self::BROK => "Brokerage Fee", + Self::BSBC => "Sell Buy Back", + Self::BSBO => "Buy Sell Back", + Self::CAJT => "Credit Adjustments (Generic)", + Self::CAPG => "Capital Gains Distribution", + Self::CASH => "Cash Letter", + Self::CCCH => "Certified Customer Cheque", + Self::CCHQ => "Cheque", + Self::CCIR => "Cross Currency IRS", + Self::CCPC => "CCP Cleared Initial Margin", + Self::CCPM => "CCP Cleared Variation Margin", + Self::CCSM => "CCP Cleared Segregated Initial Margin", + Self::CDIS => "Controlled Disbursement", + Self::CDPT => "Cash Deposit", + Self::CHAR => "Charge/Fees", + Self::CHKD => "Check Deposit", + Self::CHRG => "Charges (Generic)", + Self::CLAI => "Compensation/Claims", + Self::CLCQ => "Circular Cheque", + Self::CMBO => "Corporate Mark Broker Owned", + Self::CMCO => "Corporate Mark Client Owned", + Self::COAT => "Corporate Own Account Transfer", + Self::COME => "Commission Excluding Taxes (Generic)", + Self::COMI => "Commission Including Taxes (Generic)", + Self::COMM => "Commission (Generic)", + Self::COMT => "Non Taxable Commissions (Generic)", + Self::CONV => "Conversion", + Self::COVE => "Cover Transaction ", + Self::CPEN => "Cash Penalties", + Self::CPRB => "Corporate Rebate", + Self::CQRV => "Cheque Reversal", + Self::CRCQ => "Crossed Cheque", + Self::CRDS => "Credit DefaultSwap", + Self::CROS => "Cross Trade", + Self::CRPR => "Cross Product", + Self::CRSP => "Credit Support", + Self::CRTL => "Credit Line", + Self::CSHA => "Cash Letter Adjustment", + Self::CSLI => "Cash In Lieu", + Self::CWDL => "Cash Withdrawal", + Self::DAJT => "Debit Adjustments (Generic)", + Self::DDFT => "Discounted Draft", + Self::DDWN => "Drawdown", + Self::DECR => "Decrease in Value", + Self::DMCG => "Draft Maturity Change", + Self::DMCT => "Domestic Credit Transfer", + Self::DPST => "Deposit", + Self::DRAW => "Drawing", + Self::DRIP => "Dividend Reinvestment", + Self::DSBR => "Controlled Disbursement", + Self::DTCH => "Dutch Auction", + Self::DVCA => "Cash Dividend", + Self::DVOP => "Dividend Option", + Self::ENCT => "Nordic Payment Council Credit Transfer", + Self::EQBO => "Equity Mark Broker Owned", + Self::EQCO => "Equity Mark Client Owned", + Self::EQPT => "Equity Option", + Self::EQUS => "Equity Swap", + Self::ERTA => "Exchange Rate Adjustment", + Self::ERWA => "Lending Income", + Self::ERWI => "Borrowing Fee", + Self::ESCT => "SEPA Credit Transfer", + Self::ESDD => "SEPA Core Direct Debit", + Self::EXOF => "Exchange", + Self::EXPT => "Exotic Option", + Self::EXRI => "Call On Intermediate Securities", + Self::EXTD => "Exchange Traded Derivatives", + Self::EXWA => "Warrant Exercise/Warrant Conversion", + Self::FCDP => "Foreign Currencies Deposit", + Self::FCTA => "Factor Update", + Self::FCWD => "Foreign Currencies Withdrawal", + Self::FEES => "Fees (Generic)", + Self::FICT => "Financial Institution Credit Transfer", + Self::FIDD => "Financial Institution Direct Debit Payment", + Self::FIOA => "Financial Institution Own Account Transfer", + Self::FIXI => "Fixed Income", + Self::FLTA => "Float Adjustment", + Self::FRZF => "Freeze Of Funds", + Self::FUCO => "Futures Commission", + Self::FUTU => "Future Variation Margin", + Self::FWBC => "Forwards Broker Owned Collateral", + Self::FWCC => "Forwards Client Owned Collateral", + Self::FWSB => "MFA Segregated Broker Cash Collateral", + Self::FWSC => "MFA Segregated Client Cash Collateral", + Self::GEN1 => "Withdrawal/Distribution", + Self::GEN2 => "Deposit/Contribution", + Self::IADD => "Invoice Accepted with Differed Due Date", + Self::ICCT => "Intra Company Transfer", + Self::INFD => "Fixed Deposit Interest Amount", + Self::INSP => "Inspeci/Share Exchange", + Self::INTR => "Interests (Generic)", + Self::ISSU => "Depositary Receipt Issue", + Self::LBCA => "Credit Adjustment", + Self::LBDB => "Debit", + Self::LBDP => "Deposit", + Self::LIQU => "Liquidation Dividend / Liquidation Payment", + Self::MARG => "Margin Payments", + Self::MBSB => "Mortgage Back Segregated Broker Cash Collateral", + Self::MBSC => "Mortgage Back Segregated Client Cash Collateral", + Self::MCAL => "Full Call / Early Redemption", + Self::MGCC => "Margin Client Owned Cash Collateral", + Self::MGSC => "Initial Futures Margin Segregated Client Cash Collateral", + Self::MIXD => "Mixed Deposit", + Self::MNFE => "Management Fees", + Self::MRGR => "Merger", + Self::MSCD => "Miscellaneous Deposit", + Self::NETT => "Netting", + Self::NPCC => "Non Presented Circular Cheques", + Self::NSYN => "Non Syndicated", + Self::NTAV => "Not Available", + Self::NWID => "New issue distribution", + Self::OCCC => "Client owned OCC pledged collateral", + Self::ODFT => "Overdraft", + Self::ODLT => "Odd Lot Sale/Purchase", + Self::OODD => "One-Off Direct Debit", + Self::OPBC => "Option Broker Owned Collateral", + Self::OPCC => "Option Client Owned Collateral", + Self::OPCQ => "Open Cheque", + Self::OPSB => "OTC Option Segregated Broker Cash Collateral", + Self::OPSC => "OTC Option Segregated Client Cash Collateral", + Self::OPTN => "FX Option", + Self::ORCQ => "Order Cheque", + Self::OTCC => "OTC CCP", + Self::OTCD => "OTC Derivatives", + Self::OTCG => "OTC", + Self::OTCN => "OTC Non-CCP", + Self::OTHR => "Other", + Self::OVCH => "Overdraft Charge", + Self::OWNE => "External Account Transfer", + Self::OWNI => "Internal Account Transfer", + Self::PADD => "Pre-Authorised Direct Debit", + Self::PAIR => "Pair-Off", + Self::PCAL => "Partial Redemption with reduction of nominal value", + Self::PLAC => "Placement", + Self::PMDD => "Direct Debit", + Self::PORT => "Portfolio Move", + Self::POSC => "Credit Card Payment", + Self::POSD => "Point-of-Sale (POS) Payment - Debit Card", + Self::POSP => "Point-of-Sale (POS) Payment", + Self::PPAY => "Principal Payment", + Self::PRCT => "Priority Credit Transfer", + Self::PRDD => "Reversal Due To Payment Reversal ", + Self::PRED => "Partial Redemption Without Reduction of Nominal Value", + Self::PRII => "Interest Payment with Principles", + Self::PRIN => "Interest Payment with Principles", + Self::PRIO => "Priority Issue", + Self::PRUD => "Principal Pay-Down/Pay-Up", + Self::PSTE => "Posting Error", + Self::RCDD => "Reversal Due To Payment Cancellation Request", + Self::RCOV => "Reversal due to a Cover Transaction Return", + Self::REAA => "Redemption Asset Allocation", + Self::REDM => "Redemption", + Self::REPU => "Repo", + Self::RESI => "Futures Residual Amount", + Self::RHTS => "Rights Issue/Subscription Rights/Rights Offer", + Self::RIMB => "Reimbursement (Generic)", + Self::RNEW => "Renewal", + Self::RPBC => "Bi-lateral repo broker owned collateral", + Self::RPCC => "Repo client owned collateral", + Self::RPCR => "Reversal Due To Payment Cancellation Request ", + Self::RPMT => "Repayment", + Self::RPSB => "Bi-lateral Repo Segregated Broker Cash Collateral", + Self::RPSC => "Bi-lateral Repo Segregated Client Cash Collateral", + Self::RRTN => "Reversal Due To Payment Return", + Self::RVPO => "Reverse Repo", + Self::RWPL => "Redemption Withdrawing Plan", + Self::SABG => "Settlement Against Bank Guarantee", + Self::SALA => "Payroll/Salary Payment", + Self::SBSC => "Securities Buy Sell Sell Buy Back", + Self::SCIE => "Single Currency IRS Exotic", + Self::SCIR => "Single Currency IRS", + Self::SCRP => "Securities Cross Products", + Self::SDVA => "Same Day Value Credit Transfer", + Self::SECB => "Securities Borrowing", + Self::SECL => "Securities Lending", + Self::SHBC => "Broker owned collateral Short Sale", + Self::SHCC => "Client owned collateral Short Sale", + Self::SHPR => "Equity Premium Reserve", + Self::SHSL => "Short Sell", + Self::SLBC => "Lending Broker Owned Cash Collateral", + Self::SLCC => "Lending Client Owned Cash Collateral", + Self::SLEB => "Securities Lending And Borrowing", + Self::SLOA => "SecuredLoan", + Self::SMCD => "Smart-Card Payment", + Self::SMRT => "Smart-Card Payment", + Self::SOSE => "Settlement Of Sight Export Document", + Self::SOSI => "Settlement Of Sight Import Document", + Self::SSPL => "Subscription Savings Plan", + Self::STAC => "Settlement After Collection", + Self::STAM => "Stamp Duty", + Self::STDO => "Standing Order", + Self::STLM => "Settlement", + Self::STLR => "Settlement Under Reserve", + Self::STOD => "Bill of Exchange Settlement on Demand", + Self::SUAA => "Subscription Asset Allocation", + Self::SUBS => "Subscription", + Self::SWAP => "Swap Payment", + Self::SWBC => "Swap Broker Owned Collateral", + Self::SWCC => "Swap Client Owned Cash Collateral", + Self::SWEP => "Sweep", + Self::SWFP => "Final Payment", + Self::SWIC => "Switch", + Self::SWPP => "Partial Payment", + Self::SWPT => "Swaption", + Self::SWRS => "Reset Payment", + Self::SWSB => "ISDA/CSA Segregated Broker Cash Collateral", + Self::SWSC => "ISDA/CSA Segregated Client Cash Collateral", + Self::SWUF => "Upfront Payment", + Self::SYND => "Syndicated", + Self::TAXE => "Taxes (Generic)", + Self::TBAC => "TBA Closing", + Self::TBAS => "To Be Announced", + Self::TBBC => "TBA Broker owned cash collateral", + Self::TBCC => "TBA Client owned cash collateral", + Self::TCDP => "Travellers Cheques Deposit", + Self::TCWD => "Travellers Cheques Withdrawal", + Self::TEND => "Tender", + Self::TOPG => "Topping", + Self::TOUT => "Transfer Out", + Self::TRAD => "Trade", + Self::TRCP => "Treasury Cross Product", + Self::TREC => "Tax Reclaim", + Self::TRFE => "Transaction Fees", + Self::TRIN => "Transfer In", + Self::TRPO => "Triparty Repo", + Self::TRVO => "Triparty Reverse Repo", + Self::TTLS => "Treasury Tax And Loan Service", + Self::TURN => "Turnaround", + Self::UDFT => "Dishonoured/Unpaid Draft", + Self::UNCO => "Underwriting Commission", + Self::UPCQ => "Unpaid Cheque", + Self::UPCT => "Unpaid Card Transaction", + Self::UPDD => "Reversal Due To Return/Unpaid Direct Debit", + Self::URCQ => "Cheque Under Reserve", + Self::URDD => "Direct Debit Under Reserve", + Self::VALD => "Value Date", + Self::VCOM => "Credit Transfer With Agreed Commercial Information", + Self::WITH => "Withholding Tax", + Self::XBCP => "Cross-Border Credit Card Payment", + Self::XBCQ => "Foreign Cheque", + Self::XBCT => "Cross-Border Credit Transfer", + Self::XBCW => "Cross-Border Cash Withdrawal", + Self::XBDD => "Cross-Border Direct Debit", + Self::XBRD => "Cross-Border", + Self::XBSA => "Cross-Border Payroll/Salary Payment", + Self::XBST => "Cross-Border Standing Order", + Self::XCHC => "Exchange Traded CCP", + Self::XCHG => "Exchange Traded", + Self::XCHN => "Exchange Traded Non-CCP", + Self::XICT => "Cross-Border Intra Company Transfer", + Self::XPCQ => "Unpaid Foreign Cheque", + Self::XRCQ => "Foreign Cheque Under Reserve", + Self::XRTN => "Cross Border Reversal Due to Payment Return", + Self::YTDA => "YTD Adjustment", + Self::ZABA => "Zero Balancing", + } + } +} diff --git a/src/iso20022/external_code.rs b/src/iso20022/external_code.rs @@ -0,0 +1,2294 @@ +/* +* This file is part of LibEuFin. +* Copyright (C) 2026 Taler Systems S.A. + +* LibEuFin is free software; you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License as +* published by the Free Software Foundation; either version 3, or +* (at your option) any later version. + +* LibEuFin is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General +* Public License for more details. + +* You should have received a copy of the GNU Affero General Public +* License along with LibEuFin; see the file COPYING. If not, see +* <http://www.gnu.org/licenses/> +*/ + +// THIS FILE IS GENERATED, DO NOT EDIT + +use strum_macros::{AsRefStr, Display, EnumString}; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumString, AsRefStr, Display)] +pub enum ExternalStatusReasonCode { + /// Clearing process aborted due to timeout + #[strum(serialize = "AB01")] + AbortedClearingTimeout, + /// Clearing process aborted due to a fatal error + #[strum(serialize = "AB02")] + AbortedClearingFatalError, + /// Settlement aborted due to timeout + #[strum(serialize = "AB03")] + AbortedSettlementTimeout, + /// Settlement process aborted due to a fatal error + #[strum(serialize = "AB04")] + AbortedSettlementFatalError, + /// Transaction stopped due to timeout at the Creditor Agent + #[strum(serialize = "AB05")] + TimeoutCreditorAgent, + /// Transaction stopped due to timeout at the Instructed Agent + #[strum(serialize = "AB06")] + TimeoutInstructedAgent, + /// Agent of message is not online + #[strum(serialize = "AB07")] + OfflineAgent, + /// Creditor Agent is not online + #[strum(serialize = "AB08")] + OfflineCreditorAgent, + /// Transaction stopped due to error at the Creditor Agent + #[strum(serialize = "AB09")] + ErrorCreditorAgent, + /// Transaction stopped due to error at the Instructed Agent + #[strum(serialize = "AB10")] + ErrorInstructedAgent, + /// Transaction stopped due to timeout at the Debtor Agent + #[strum(serialize = "AB11")] + TimeoutDebtorAgent, + /// Duplicate Concurrent Batch Sequence number– for Settlement Instructions + #[strum(serialize = "AB12")] + InvalidConcurrentBatch, + /// Wrong Message Routing Type for Return-of-Funds + #[strum(serialize = "AB13")] + InvalidRoutingCodeUtilised, + /// Instruction may not be placed on the Continuous Processing Line settlement processor + #[strum(serialize = "AB15")] + InvalidAccountNumberForSettlementType, + /// Agreement number not valid (beneficiary) + #[strum(serialize = "AB21")] + InvalidSettlementAgreementNumberSpecified, + /// Settlement Instruction does not exist + #[strum(serialize = "AB26")] + InvalidBatchSettlementInstruction, + /// Account number is invalid or missing + #[strum(serialize = "AC01")] + IncorrectAccountNumber, + /// Debtor account number invalid or missing + #[strum(serialize = "AC02")] + InvalidDebtorAccountNumber, + /// Creditor account number invalid or missing + #[strum(serialize = "AC03")] + InvalidCreditorAccountNumber, + /// Account number specified has been closed on the bank of account's books + #[strum(serialize = "AC04")] + ClosedAccountNumber, + /// Debtor account number closed + #[strum(serialize = "AC05")] + ClosedDebtorAccountNumber, + /// Account specified is blocked, prohibiting posting of transactions against it + #[strum(serialize = "AC06")] + BlockedAccount, + /// Creditor account number closed + #[strum(serialize = "AC07")] + ClosedCreditorAccountNumber, + /// Branch code is invalid or missing + #[strum(serialize = "AC08")] + InvalidBranchCode, + /// Account currency is invalid or missing + #[strum(serialize = "AC09")] + InvalidAccountCurrency, + /// Debtor account currency is invalid or missing + #[strum(serialize = "AC10")] + InvalidDebtorAccountCurrency, + /// Creditor account currency is invalid or missing + #[strum(serialize = "AC11")] + InvalidCreditorAccountCurrency, + /// Account type missing or invalid + #[strum(serialize = "AC12")] + InvalidAccountType, + /// Debtor account type missing or invalid + #[strum(serialize = "AC13")] + InvalidDebtorAccountType, + /// Creditor account type missing or invalid + #[strum(serialize = "AC14")] + InvalidCreditorAccountType, + /// The account details for the counterparty have changed + #[strum(serialize = "AC15")] + AccountDetailsChanged, + /// Credit or debit card number is invalid + #[strum(serialize = "AC16")] + CardNumberInvalid, + /// Request-to-pay Expiry Date and Time has already passed + #[strum(serialize = "AEXR")] + AlreadyExpiredRTP, + /// Transaction forbidden on this type of account (formerly NoAgreement) + #[strum(serialize = "AG01")] + TransactionForbidden, + /// Bank Operation code specified in the message is not valid for receiver + #[strum(serialize = "AG02")] + InvalidBankOperationCode, + /// Transaction type not supported/authorized on this account + #[strum(serialize = "AG03")] + TransactionNotSupported, + /// Agent country code is missing or invalid + #[strum(serialize = "AG04")] + InvalidAgentCountry, + /// Debtor agent country code is missing or invalid + #[strum(serialize = "AG05")] + InvalidDebtorAgentCountry, + /// Creditor agent country code is missing or invalid + #[strum(serialize = "AG06")] + InvalidCreditorAgentCountry, + /// Debtor account cannot be debited for a generic reason + #[strum(serialize = "AG07")] + UnsuccesfulDirectDebit, + /// Transaction failed due to invalid or missing user or access right + #[strum(serialize = "AG08")] + InvalidAccessRights, + /// Original payment never received + #[strum(serialize = "AG09")] + PaymentNotReceived, + /// Agent of message is suspended from the Real Time Payment system + #[strum(serialize = "AG10")] + AgentSuspended, + /// Creditor Agent of message is suspended from the Real Time Payment system + #[strum(serialize = "AG11")] + CreditorAgentSuspended, + /// Payment orders made by transferring funds from one account to another at the same financial institution (bank or payment institution) are not allowed + #[strum(serialize = "AG12")] + NotAllowedBookTransfer, + /// Returned payments derived from previously returned transactions are not allowed + #[strum(serialize = "AG13")] + ForbiddenReturnPayment, + /// Agent in the payment workflow is incorrect + #[strum(serialize = "AGNT")] + IncorrectAgent, + /// Request-to-pay has already been accepted by the Debtor + #[strum(serialize = "ALAC")] + AlreadyAcceptedRTP, + /// Specified message amount is equal to zero + #[strum(serialize = "AM01")] + ZeroAmount, + /// Specific transaction/message amount is greater than allowed maximum + #[strum(serialize = "AM02")] + NotAllowedAmount, + /// Specified message amount is an non processable currency outside of existing agreement + #[strum(serialize = "AM03")] + NotAllowedCurrency, + /// Amount of funds available to cover specified message amount is insufficient + #[strum(serialize = "AM04")] + InsufficientFunds, + /// Duplication + #[strum(serialize = "AM05")] + Duplication, + /// Specified transaction amount is less than agreed minimum + #[strum(serialize = "AM06")] + TooLowAmount, + /// Amount specified in message has been blocked by regulatory authorities + #[strum(serialize = "AM07")] + BlockedAmount, + /// Amount received is not the amount agreed or expected + #[strum(serialize = "AM09")] + WrongAmount, + /// Sum of instructed amounts does not equal the control sum + #[strum(serialize = "AM10")] + InvalidControlSum, + /// Transaction currency is invalid or missing + #[strum(serialize = "AM11")] + InvalidTransactionCurrency, + /// Amount is invalid or missing + #[strum(serialize = "AM12")] + InvalidAmount, + /// Transaction amount exceeds limits set by clearing system + #[strum(serialize = "AM13")] + AmountExceedsClearingSystemLimit, + /// Transaction amount exceeds limits agreed between bank and client + #[strum(serialize = "AM14")] + AmountExceedsAgreedLimit, + /// Transaction amount below minimum set by clearing system + #[strum(serialize = "AM15")] + AmountBelowClearingSystemMinimum, + /// Control Sum at the Group level is invalid + #[strum(serialize = "AM16")] + InvalidGroupControlSum, + /// Control Sum at the Payment Information level is invalid + #[strum(serialize = "AM17")] + InvalidPaymentInfoControlSum, + /// Number of transactions is invalid or missing + #[strum(serialize = "AM18")] + InvalidNumberOfTransactions, + /// Number of transactions at the Group level is invalid or missing + #[strum(serialize = "AM19")] + InvalidGroupNumberOfTransactions, + /// Number of transactions at the Payment Information level is invalid + #[strum(serialize = "AM20")] + InvalidPaymentInfoNumberOfTransactions, + /// Transaction amount exceeds limits agreed between bank and client + #[strum(serialize = "AM21")] + LimitExceeded, + /// Unable to apply zero amount to designated account + #[strum(serialize = "AM22")] + ZeroAmountNotApplied, + /// Transaction amount exceeds settlement limit + #[strum(serialize = "AM23")] + AmountExceedsSettlementLimit, + /// Size of the attachment exceeds the allowed maximum + #[strum(serialize = "AMSE")] + AttachmentMaximumSize, + /// Request To Pay has already been paid by the Debtor + #[strum(serialize = "APAR")] + AlreadyPaidRTP, + /// Request-to-pay has already been refused by the Debtor + #[strum(serialize = "ARFR")] + AlreadyRefusedRTP, + /// Request-to-pay has already been rejected + #[strum(serialize = "ARJR")] + AlreadyRejectedRTP, + /// Attachments to the request-to-pay are not supported + #[strum(serialize = "ATNS")] + AttachementsNotSupported, + /// Settlement Cycle Day and Calendar day should be the same + #[strum(serialize = "BDAY")] + NotBusinessDay, + /// Identification of end customer is not consistent with associated account number + #[strum(serialize = "BE01")] + InconsistenWithEndCustomer, + /// Specification of creditor's address, which is required for payment, is missing/not correct (formerly IncorrectCreditorAddress) + #[strum(serialize = "BE04")] + MissingCreditorAddress, + /// Party who initiated the message is not recognised by the end customer + #[strum(serialize = "BE05")] + UnrecognisedInitiatingParty, + /// End customer specified is not known at associated Sort/National Bank Code or does no longer exist in the books + #[strum(serialize = "BE06")] + UnknownEndCustomer, + /// Specification of debtor's address, which is required for payment, is missing/not correct + #[strum(serialize = "BE07")] + MissingDebtorAddress, + /// Debtor name is missing + #[strum(serialize = "BE08")] + MissingDebtorName, + /// Country code is missing or Invalid + #[strum(serialize = "BE09")] + InvalidCountry, + /// Debtor country code is missing or invalid + #[strum(serialize = "BE10")] + InvalidDebtorCountry, + /// Creditor country code is missing or invalid + #[strum(serialize = "BE11")] + InvalidCreditorCountry, + /// Country code of residence is missing or Invalid + #[strum(serialize = "BE12")] + InvalidCountryOfResidence, + /// Country code of debtor's residence is missing or Invalid + #[strum(serialize = "BE13")] + InvalidDebtorCountryOfResidence, + /// Country code of creditor's residence is missing or Invalid + #[strum(serialize = "BE14")] + InvalidCreditorCountryOfResidence, + /// Identification code missing or invalid + #[strum(serialize = "BE15")] + InvalidIdentificationCode, + /// Debtor or Ultimate Debtor identification code missing or invalid + #[strum(serialize = "BE16")] + InvalidDebtorIdentificationCode, + /// Creditor or Ultimate Creditor identification code missing or invalid + #[strum(serialize = "BE17")] + InvalidCreditorIdentificationCode, + /// Contact details missing or invalid + #[strum(serialize = "BE18")] + InvalidContactDetails, + /// Charge bearer code for transaction type is invalid + #[strum(serialize = "BE19")] + InvalidChargeBearerCode, + /// Name length exceeds local rules for payment type + #[strum(serialize = "BE20")] + InvalidNameLength, + /// Name missing or invalid + #[strum(serialize = "BE21")] + MissingName, + /// Creditor name is missing + #[strum(serialize = "BE22")] + MissingCreditorName, + /// Phone number or email address, or any other proxy, used as the account proxy is unknown or invalid + #[strum(serialize = "BE23")] + AccountProxyInvalid, + /// Credit transfer is not tagged as an Extended Remittance Information (ERI) transaction but contains ERI + #[strum(serialize = "CERI")] + CheckERI, + /// Value in Requested Execution Date or Requested Collection Date is too far in the future + #[strum(serialize = "CH03")] + RequestedExecutionDateOrRequestedCollectionDateTooFarInFuture, + /// Value in Requested Execution Date or Requested Collection Date is too far in the past + #[strum(serialize = "CH04")] + RequestedExecutionDateOrRequestedCollectionDateTooFarInPast, + /// Element is not to be used at B- and C-Level + #[strum(serialize = "CH07")] + ElementIsNotToBeUsedAtBandCLevel, + /// Mandate changes are not allowed + #[strum(serialize = "CH09")] + MandateChangesNotAllowed, + /// Information on mandate changes are missing + #[strum(serialize = "CH10")] + InformationOnMandateChangesMissing, + /// Value in Creditor Identifier is incorrect + #[strum(serialize = "CH11")] + CreditorIdentifierIncorrect, + /// Creditor Identifier is ambiguous at Transaction Level + #[strum(serialize = "CH12")] + CreditorIdentifierNotUnambiguouslyAtTransactionLevel, + /// Original Debtor Account is not to be used + #[strum(serialize = "CH13")] + OriginalDebtorAccountIsNotToBeUsed, + /// Original Debtor Agent is not to be used + #[strum(serialize = "CH14")] + OriginalDebtorAgentIsNotToBeUsed, + /// Content Remittance Information/Structured includes more than 140 characters + #[strum(serialize = "CH15")] + ElementContentIncludesMoreThan140Characters, + /// Content is incorrect + #[strum(serialize = "CH16")] + ElementContentFormallyIncorrect, + /// Element is not allowed + #[strum(serialize = "CH17")] + ElementNotAdmitted, + /// Values in Interbank Settlement Date or Requested Collection Date will be set to the next TARGET day + #[strum(serialize = "CH19")] + ValuesWillBeSetToNextTARGETday, + /// Number of decimal points not compatible with the currency + #[strum(serialize = "CH20")] + DecimalPointsNotCompatibleWithCurrency, + /// Mandatory element is missing + #[strum(serialize = "CH21")] + RequiredCompulsoryElementMissing, + /// SDD CORE and B2B not permitted within one message + #[strum(serialize = "CH22")] + COREandB2BwithinOnemessage, + /// Related to a Charge message to convey that the code in Charge Breakdown / Type / Code is not accepted by the receiving party + #[strum(serialize = "CHCO")] + UnacceptedChargeCodeType, + /// Cheque has been presented in cheque clearing and settled on the creditor’s account + #[strum(serialize = "CHQC")] + ChequeSettledOnCreditorAccount, + /// Related to a Charge message to convey that the charge bearer code used in the corresponding Payment message was not debt + #[strum(serialize = "CHRG")] + UnderlyingChargeBearerWasNotDebt, + /// Authorisation is cancelled + #[strum(serialize = "CN01")] + AuthorisationCancelled, + /// Credit notes are not supported + #[strum(serialize = "CNNS")] + CreditNotesNotSupported, + /// Creditor bank is not registered under this BIC in the CSM + #[strum(serialize = "CNOR")] + CreditorBankIsNotRegistered, + /// Currency of the payment is incorrect + #[strum(serialize = "CURR")] + IncorrectCurrency, + /// Cancellation requested by the Debtor + #[strum(serialize = "CUST")] + RequestedByCustomer, + /// Rejection of a payment due to covering FI settlement not being received + #[strum(serialize = "DC02")] + SettlementNotReceived, + /// Debtor bank is not registered under this BIC in the CSM + #[strum(serialize = "DNOR")] + DebtorBankIsNotRegistered, + /// The electronic signature(s) is/are correct + #[strum(serialize = "DS01")] + ElectronicSignaturesCorrect, + /// An authorized user has cancelled the order + #[strum(serialize = "DS02")] + OrderCancelled, + /// The user’s attempt to cancel the order was not successful + #[strum(serialize = "DS03")] + OrderNotCancelled, + /// The order was rejected by the bank side (for reasons concerning content) + #[strum(serialize = "DS04")] + OrderRejected, + /// The order was correct and could be forwarded for postprocessing + #[strum(serialize = "DS05")] + OrderForwardedForPostprocessing, + /// The order was transferred to VEU + #[strum(serialize = "DS06")] + TransferOrder, + /// All actions concerning the order could be done by the EBICS bank server + #[strum(serialize = "DS07")] + ProcessingOK, + /// The decompression of the file was not successful + #[strum(serialize = "DS08")] + DecompressionError, + /// The decryption of the file was not successful + #[strum(serialize = "DS09")] + DecryptionError, + /// Data signature is required + #[strum(serialize = "DS0A")] + DataSignRequested, + /// Data signature for the format is not available or invalid + #[strum(serialize = "DS0B")] + UnknownDataSignFormat, + /// The signer certificate is revoked + #[strum(serialize = "DS0C")] + SignerCertificateRevoked, + /// The signer certificate is not valid (revoked or not active) + #[strum(serialize = "DS0D")] + SignerCertificateNotValid, + /// The signer certificate is not present + #[strum(serialize = "DS0E")] + IncorrectSignerCertificate, + /// The authority of the signer certification sending the certificate is unknown + #[strum(serialize = "DS0F")] + SignerCertificationAuthoritySignerNotValid, + /// Signer is not allowed to sign this operation type + #[strum(serialize = "DS0G")] + NotAllowedPayment, + /// Signer is not allowed to sign for this account + #[strum(serialize = "DS0H")] + NotAllowedAccount, + /// The number of transaction is over the number allowed for this signer + #[strum(serialize = "DS0K")] + NotAllowedNumberOfTransaction, + /// The certificate is revoked for the first signer + #[strum(serialize = "DS10")] + Signer1CertificateRevoked, + /// The certificate is not valid (revoked or not active) for the first signer + #[strum(serialize = "DS11")] + Signer1CertificateNotValid, + /// The certificate is not present for the first signer + #[strum(serialize = "DS12")] + IncorrectSigner1Certificate, + /// The authority of signer certification sending the certificate is unknown for the first signer + #[strum(serialize = "DS13")] + SignerCertificationAuthoritySigner1NotValid, + /// The user is unknown on the server + #[strum(serialize = "DS14")] + UserDoesNotExist, + /// The same signature has already been sent to the bank + #[strum(serialize = "DS15")] + IdenticalSignatureFound, + /// The public key version is not correct + #[strum(serialize = "DS16")] + PublicKeyVersionIncorrect, + /// Order data and signatures don’t match + #[strum(serialize = "DS17")] + DifferentOrderDataInSignatures, + /// File cannot be tested, the complete order has to be repeated + #[strum(serialize = "DS18")] + RepeatOrder, + /// The user’s rights (concerning his signature) are insufficient to execute the order + #[strum(serialize = "DS19")] + ElectronicSignatureRightsInsufficient, + /// The certificate is revoked for the second signer + #[strum(serialize = "DS20")] + Signer2CertificateRevoked, + /// The certificate is not valid (revoked or not active) for the second signer + #[strum(serialize = "DS21")] + Signer2CertificateNotValid, + /// The certificate is not present for the second signer + #[strum(serialize = "DS22")] + IncorrectSigner2Certificate, + /// The authority of signer certification sending the certificate is unknown for the second signer + #[strum(serialize = "DS23")] + SignerCertificationAuthoritySigner2NotValid, + /// Waiting time expired due to incomplete order + #[strum(serialize = "DS24")] + WaitingTimeExpired, + /// The order file was deleted by the bank server + #[strum(serialize = "DS25")] + OrderFileDeleted, + /// The same user has signed multiple times + #[strum(serialize = "DS26")] + UserSignedMultipleTimes, + /// The user is not yet activated (technically) + #[strum(serialize = "DS27")] + UserNotYetActivated, + /// Message routed to the wrong environment + #[strum(serialize = "DS28")] + ReturnForTechnicalReason, + /// Invalid date (eg, wrong or missing settlement date) + #[strum(serialize = "DT01")] + InvalidDate, + /// Invalid creation date and time in Group Header (eg, historic date) + #[strum(serialize = "DT02")] + InvalidCreationDate, + /// Invalid non bank processing date (eg, weekend or local public holiday) + #[strum(serialize = "DT03")] + InvalidNonProcessingDate, + /// Future date not supported + #[strum(serialize = "DT04")] + FutureDateNotSupported, + /// Associated message, payment information block or transaction was received after agreed processing cut-off date, i + #[strum(serialize = "DT05")] + InvalidCutOffDate, + /// Execution Date has been modified in order for transaction to be processed + #[strum(serialize = "DT06")] + ExecutionDateChanged, + /// Message Identification is not unique + #[strum(serialize = "DU01")] + DuplicateMessageID, + /// Payment Information Block is not unique + #[strum(serialize = "DU02")] + DuplicatePaymentInformationID, + /// Transaction is not unique + #[strum(serialize = "DU03")] + DuplicateTransaction, + /// End To End ID is not unique + #[strum(serialize = "DU04")] + DuplicateEndToEndID, + /// Instruction ID is not unique + #[strum(serialize = "DU05")] + DuplicateInstructionID, + /// Payment or charge is a duplicate of another payment or charge + #[strum(serialize = "DUPL")] + DuplicatePaymentOrCharge, + /// Correspondent bank not possible + #[strum(serialize = "ED01")] + CorrespondentBankNotPossible, + /// Balance of payments complementary info is requested + #[strum(serialize = "ED03")] + BalanceInfoRequest, + /// Settlement of the transaction has failed + #[strum(serialize = "ED05")] + SettlementFailed, + /// Interbank settlement system not available + #[strum(serialize = "ED06")] + SettlementSystemNotAvailable, + /// Requested execution date of the payment is not accepted + #[strum(serialize = "EDNA")] + ExecutionDateNotAccepted, + /// Expiry date time of the request-to-pay is too far in the future + #[strum(serialize = "EDTL")] + ExpiryDateTooLong, + /// Expiry date time of the request-to-pay is already reached + #[strum(serialize = "EDTR")] + ExpiryDateTimeReached, + /// Expiration of the payment authorisation due to no use for too long + #[strum(serialize = "EOL1")] + EndOfLife, + /// Extended Remittance Information (ERI) option is not supported + #[strum(serialize = "ERIN")] + ERIOptionNotSupported, + /// File Format incomplete or invalid + #[strum(serialize = "FF01")] + InvalidFileFormat, + /// Syntax error reason is provided as narrative information in the additional reason information + #[strum(serialize = "FF02")] + SyntaxError, + /// Payment Type Information is missing or invalid + #[strum(serialize = "FF03")] + InvalidPaymentTypeInformation, + /// Service Level code is missing or invalid + #[strum(serialize = "FF04")] + InvalidServiceLevelCode, + /// Local Instrument code is missing or invalid + #[strum(serialize = "FF05")] + InvalidLocalInstrumentCode, + /// Category Purpose code is missing or invalid + #[strum(serialize = "FF06")] + InvalidCategoryPurposeCode, + /// Purpose is missing or invalid + #[strum(serialize = "FF07")] + InvalidPurpose, + /// End to End Id missing or invalid + #[strum(serialize = "FF08")] + InvalidEndToEndId, + /// Cheque number missing or invalid + #[strum(serialize = "FF09")] + InvalidChequeNumber, + /// File or transaction cannot be processed due to technical issues at the bank side + #[strum(serialize = "FF10")] + BankSystemProcessingError, + /// Clearing request rejected due it being subject to an abort operation + #[strum(serialize = "FF11")] + ClearingRequestAborted, + /// Original payment is not eligible to be returned given its current status + #[strum(serialize = "FF12")] + OriginalTransactionNotEligibleForRequestedReturn, + /// No record of request for cancellation found + #[strum(serialize = "FF13")] + RequestForCancellationNotFound, + /// Return following a cancellation request + #[strum(serialize = "FOCR")] + FollowingCancellationRequest, + /// Returned as a result of fraud + #[strum(serialize = "FR01")] + Fraud, + /// Cancellation requested following a transaction that was originated fraudulently + #[strum(serialize = "FRAD")] + FraudulentOrigin, + /// In an FI To FI Customer Credit Transfer: The Status Originator transferred the payment to the next Agent or to a Market Infrastructure + #[strum(serialize = "G000")] + PaymentTransferredAndTracked, + /// In an FI To FI Customer Credit Transfer: The Status Originator transferred the payment to the next Agent or to a Market Infrastructure + #[strum(serialize = "G001")] + PaymentTransferredAndNotTracked, + /// In a FIToFI Customer Credit Transfer: Credit to the creditor’s account may not be confirmed same day + #[strum(serialize = "G002")] + CreditDebitNotConfirmed, + /// In a FIToFI Customer Credit Transfer: Credit to creditor’s account is pending receipt of required documents + #[strum(serialize = "G003")] + CreditPendingDocuments, + /// In a FIToFI Customer Credit Transfer: Credit to the creditor’s account is pending, status Originator is waiting for funds provided via a cover + #[strum(serialize = "G004")] + CreditPendingFunds, + /// Payment has been delivered to creditor agent with service level + #[strum(serialize = "G005")] + DeliveredWithServiceLevel, + /// Payment has been delivered to creditor agent without service level + #[strum(serialize = "G006")] + DeliveredWIthoutServiceLevel, + /// Signature file was sent to the bank but the corresponding original file has not been sent yet + #[strum(serialize = "ID01")] + CorrespondingOriginalFileStillNotSent, + /// Expiry date time of the request-to-pay is incorrect + #[strum(serialize = "IEDT")] + IncorrectExpiryDateTime, + /// Payer’s activation reference is invalid + #[strum(serialize = "INAR")] + InvalidActivationReference, + /// Details not valid for this field + #[strum(serialize = "INDT")] + InvalidDetails, + /// Payments in instalments are not supported + #[strum(serialize = "IPNS")] + InstalmentPaymentsNotSupported, + /// No initial request-to-pay has been received + #[strum(serialize = "IRNR")] + InitialRTPNeverReceived, + /// Cannot schedule instruction for Night Window + #[strum(serialize = "ISWS")] + InvalidSettlementWindow, + /// No Mandate + #[strum(serialize = "MD01")] + NoMandate, + /// Mandate related information data required by the scheme is missing + #[strum(serialize = "MD02")] + MissingMandatoryInformationInMandate, + /// Creditor or creditor's agent should not have collected the direct debit + #[strum(serialize = "MD05")] + CollectionNotDue, + /// Return of funds requested by end customer + #[strum(serialize = "MD06")] + RefundRequestByEndCustomer, + /// End customer is deceased + #[strum(serialize = "MD07")] + EndCustomerDeceased, + /// Information missing for the field or cannot be empty + #[strum(serialize = "MINF")] + MissingInformation, + /// Reason has not been specified by end customer + #[strum(serialize = "MS02")] + NotSpecifiedReasonCustomerGenerated, + /// Reason has not been specified by agent + #[strum(serialize = "MS03")] + NotSpecifiedReasonAgentGenerated, + /// Reason is provided as narrative information in the additional reason information + #[strum(serialize = "NARR")] + Narrative, + /// Credit transfer is tagged as an Extended Remittance Information (ERI) transaction but does not contain ERI + #[strum(serialize = "NERI")] + NoERI, + /// No existing agreement for receiving request-to-pay messages + #[strum(serialize = "NOAR")] + NonAgreedRTP, + /// No response from Beneficiary + #[strum(serialize = "NOAS")] + NoAnswerFromCustomer, + /// Customer account is not compliant with regulatory requirements, for example FICA (in South Africa) or any other regulatory requirements which render an account inactive for certain processing + #[strum(serialize = "NOCM")] + NotCompliantGeneric, + /// Continuous Processing Line on Hold Instruction + #[strum(serialize = "NOFR")] + OutstandingFundingForSettlement, + /// Requested payment guarantee (by Creditor) related to a request-to-pay cannot be provided + #[strum(serialize = "NOPG")] + NoPaymentGuarantee, + /// Recipient side of the request-to-pay (payer or its request-to-pay service provider) is not reachable + #[strum(serialize = "NRCH")] + PayerOrPayerRTPSPNotReachable, + /// Requested optional service (for example instalment payments) is not supported + #[strum(serialize = "OSNS")] + OptionalServiceNotSupported, + /// Type of payment requested in the request-to-pay is not supported by the payer + #[strum(serialize = "PINS")] + TypeOfPaymentInstrumentNotSupported, + /// Error code used for RTP-initiated CTR when the pacs + #[strum(serialize = "PNRT")] + PaymentNotAlignedWithRTPRequest, + /// Bank identifier code specified in the message has an incorrect format (formerly IncorrectFormatForRoutingCode) + #[strum(serialize = "RC01")] + BankIdentifierIncorrect, + /// Bank identifier is invalid or missing + #[strum(serialize = "RC02")] + InvalidBankIdentifier, + /// Debtor bank identifier is invalid or missing + #[strum(serialize = "RC03")] + InvalidDebtorBankIdentifier, + /// Creditor bank identifier is invalid or missing + #[strum(serialize = "RC04")] + InvalidCreditorBankIdentifier, + /// BIC identifier is invalid or missing + #[strum(serialize = "RC05")] + InvalidBICIdentifier, + /// Debtor BIC identifier is invalid or missing + #[strum(serialize = "RC06")] + InvalidDebtorBICIdentifier, + /// Creditor BIC identifier is invalid or missing + #[strum(serialize = "RC07")] + InvalidCreditorBICIdentifier, + /// ClearingSystemMemberidentifier is invalid or missing + #[strum(serialize = "RC08")] + InvalidClearingSystemMemberIdentifier, + /// Debtor ClearingSystemMember identifier is invalid or missing + #[strum(serialize = "RC09")] + InvalidDebtorClearingSystemMemberIdentifier, + /// Creditor ClearingSystemMember identifier is invalid or missing + #[strum(serialize = "RC10")] + InvalidCreditorClearingSystemMemberIdentifier, + /// Intermediary Agent is invalid or missing + #[strum(serialize = "RC11")] + InvalidIntermediaryAgent, + /// Creditor Scheme Id is invalid or missing + #[strum(serialize = "RC12")] + MissingCreditorSchemeId, + /// Originator not active any more + #[strum(serialize = "RC13")] + ParticipantNotAnActiveMemberofRTGS, + /// Settlement agreement required + #[strum(serialize = "RC15")] + ParticipantNotActiveMemberSettlementType, + /// Participant blocked from SADC-RTGS + #[strum(serialize = "RC16")] + ParticipantNotActiveMemberofSADCRTGS, + /// Conflict with R-Message + #[strum(serialize = "RCON")] + RMessageConflict, + /// Further information regarding the intended recipient + #[strum(serialize = "RECI")] + ReceiverCustomerInformation, + /// Request-to-pay has been received and can be processed further + #[strum(serialize = "REPR")] + RTPReceivedCanBeProcessed, + /// Transaction reference is not unique within the message + #[strum(serialize = "RF01")] + NotUniqueTransactionReference, + /// Payer did not recognize the request from Payee Participant, + #[strum(serialize = "RQNR")] + RequestNotRecognized, + /// Specification of the debtor’s account or unique identification needed for reasons of regulatory requirements is insufficient or missing + #[strum(serialize = "RR01")] + MissingDebtorAccountOrIdentification, + /// Specification of the debtor’s name and/or address needed for regulatory requirements is insufficient or missing + #[strum(serialize = "RR02")] + MissingDebtorNameOrAddress, + /// Specification of the creditor’s name and/or address needed for regulatory requirements is insufficient or missing + #[strum(serialize = "RR03")] + MissingCreditorNameOrAddress, + /// Regulatory Reason + #[strum(serialize = "RR04")] + RegulatoryReason, + /// Regulatory or Central Bank Reporting information missing, incomplete or invalid + #[strum(serialize = "RR05")] + RegulatoryInformationInvalid, + /// Tax information missing, incomplete or invalid + #[strum(serialize = "RR06")] + TaxInformationInvalid, + /// Remittance information structure does not comply with rules for payment type + #[strum(serialize = "RR07")] + RemittanceInformationInvalid, + /// Remittance information truncated to comply with rules for payment type + #[strum(serialize = "RR08")] + RemittanceInformationTruncated, + /// Structured creditor reference invalid or missing + #[strum(serialize = "RR09")] + InvalidStructuredCreditorReference, + /// Character set supplied not valid for the country and payment type + #[strum(serialize = "RR10")] + InvalidCharacterSet, + /// Invalid or missing identification of a bank proprietary service + #[strum(serialize = "RR11")] + InvalidDebtorAgentServiceID, + /// Invalid or missing identification required within a particular country or payment type + #[strum(serialize = "RR12")] + InvalidPartyID, + /// Debtor does not support request-to-pay transactions + #[strum(serialize = "RTNS")] + RTPNotSupportedForDebtor, + /// Return following investigation request and no remediation possible + #[strum(serialize = "RUTA")] + ReturnUponUnableToApply, + /// Request for Cancellation is acknowledged following validation + #[strum(serialize = "S000")] + ValidRequestForCancellationAcknowledged, + /// Unique End-to-end Transaction Reference (UETR) relating to a payment has been identified as being associated with a Request for Cancellation + #[strum(serialize = "S001")] + UETRFlaggedForCancellation, + /// Unique End-to-end Transaction Reference (UETR) relating to a payment has been prevent from traveling across a messaging network + #[strum(serialize = "S002")] + NetworkStopOfUETR, + /// Request for Cancellation has been forwarded to the payment processing/last payment processing agent + #[strum(serialize = "S003")] + RequestForCancellationForwarded, + /// Request for Cancellation has been acknowledged as delivered to payment processing/last payment processing agent + #[strum(serialize = "S004")] + RequestForCancellationDeliveryAcknowledgement, + /// Remove Concurrent Batch Processing Line on hold instruction + #[strum(serialize = "SBRN")] + SettlementBatchRemovalNotification, + /// Due to specific service offered by the Debtor Agent + #[strum(serialize = "SL01")] + SpecificServiceOfferedByDebtorAgent, + /// Due to specific service offered by the Creditor Agent + #[strum(serialize = "SL02")] + SpecificServiceOfferedByCreditorAgent, + /// Due to a specific service offered by the clearing system + #[strum(serialize = "SL03")] + ServiceofClearingSystem, + /// Whitelisting service offered by the Debtor Agent; Debtor has not included the Creditor on its “Whitelist” (yet) + #[strum(serialize = "SL11")] + CreditorNotOnWhitelistOfDebtor, + /// Blacklisting service offered by the Debtor Agent; Debtor included the Creditor on his “Blacklist” + #[strum(serialize = "SL12")] + CreditorOnBlacklistOfDebtor, + /// Due to Maximum allowed Direct Debit Transactions per period service offered by the Debtor Agent + #[strum(serialize = "SL13")] + MaximumNumberOfDirectDebitTransactionsExceeded, + /// Due to Maximum allowed Direct Debit Transaction amount service offered by the Debtor Agent + #[strum(serialize = "SL14")] + MaximumDirectDebitTransactionAmountExceeded, + /// Maximum number of credit transactions allowed by the account servicer per service period exceeded + #[strum(serialize = "SL15")] + MaximumNumberOfCreditTransactionsExceeded, + /// Maximum total credit amount allowed by the account servicer per service period exceeded + #[strum(serialize = "SL16")] + MaximumCreditTransactionsAmountExceeded, + /// Whitelisting service offered by payment system operator or financial institution + #[strum(serialize = "SL17")] + DebtorNotOnWhitelistOfCreditorSide, + /// Blacklisting service offered by payment system operator or financial institution + #[strum(serialize = "SL18")] + DebtorOnBlacklistOfCreditorSide, + /// Services are not yet rendered by the Payee Participant (Creditor) + #[strum(serialize = "SNRD")] + ServiceNotRendered, + /// Identifier of the request-to-pay service provider is incorrect + #[strum(serialize = "SPII")] + RTPServiceProviderIdentifierIncorrect, + /// The transmission of the file was not successful – it had to be aborted (for technical reasons) + #[strum(serialize = "TA01")] + TransmissonAborted, + /// There is no data available (for download) + #[strum(serialize = "TD01")] + NoDataAvailable, + /// The file cannot be read (e + #[strum(serialize = "TD02")] + FileNonReadable, + /// The file format is incomplete or invalid + #[strum(serialize = "TD03")] + IncorrectFileStructure, + /// Token is invalid + #[strum(serialize = "TK01")] + TokenInvalid, + /// Token used for the sender does not exist + #[strum(serialize = "TK02")] + SenderTokenNotFound, + /// Token used for the receiver does not exist + #[strum(serialize = "TK03")] + ReceiverTokenNotFound, + /// Token required for request is missing + #[strum(serialize = "TK09")] + TokenMissing, + /// Token found with counterparty mismatch + #[strum(serialize = "TKCM")] + TokenCounterpartyMismatch, + /// Single Use Token already used + #[strum(serialize = "TKSG")] + TokenSingleUse, + /// Token found with suspended status + #[strum(serialize = "TKSP")] + TokenSuspended, + /// Token found with value limit rule violation + #[strum(serialize = "TKVE")] + TokenValueLimitExceeded, + /// Token expired + #[strum(serialize = "TKXP")] + TokenExpired, + /// Associated message, payment information block, or transaction was received after agreed processing cut-off time + #[strum(serialize = "TM01")] + InvalidCutOffTime, + /// The (technical) transmission of the file was successful + #[strum(serialize = "TS01")] + TransmissionSuccessful, + /// The order was transferred to pass by accompanying note signed by hand + #[strum(serialize = "TS04")] + TransferToSignByHand, + /// Unknown Creditor + #[strum(serialize = "UCRD")] + UnknownCreditor, + /// Payment is not justified + #[strum(serialize = "UPAY")] + UnduePayment, +} +impl ExternalStatusReasonCode { + pub fn description(&self) -> &'static str { + match self { + Self::AbortedClearingTimeout => "Clearing process aborted due to timeout", + Self::AbortedClearingFatalError => "Clearing process aborted due to a fatal error", + Self::AbortedSettlementTimeout => "Settlement aborted due to timeout", + Self::AbortedSettlementFatalError => "Settlement process aborted due to a fatal error", + Self::TimeoutCreditorAgent => { + "Transaction stopped due to timeout at the Creditor Agent" + } + Self::TimeoutInstructedAgent => { + "Transaction stopped due to timeout at the Instructed Agent" + } + Self::OfflineAgent => "Agent of message is not online", + Self::OfflineCreditorAgent => "Creditor Agent is not online", + Self::ErrorCreditorAgent => "Transaction stopped due to error at the Creditor Agent", + Self::ErrorInstructedAgent => { + "Transaction stopped due to error at the Instructed Agent" + } + Self::TimeoutDebtorAgent => "Transaction stopped due to timeout at the Debtor Agent", + Self::InvalidConcurrentBatch => { + "Duplicate Concurrent Batch Sequence number– for Settlement Instructions" + } + Self::InvalidRoutingCodeUtilised => "Wrong Message Routing Type for Return-of-Funds", + Self::InvalidAccountNumberForSettlementType => { + "Instruction may not be placed on the Continuous Processing Line settlement processor" + } + Self::InvalidSettlementAgreementNumberSpecified => { + "Agreement number not valid (beneficiary)" + } + Self::InvalidBatchSettlementInstruction => "Settlement Instruction does not exist", + Self::IncorrectAccountNumber => "Account number is invalid or missing", + Self::InvalidDebtorAccountNumber => "Debtor account number invalid or missing", + Self::InvalidCreditorAccountNumber => "Creditor account number invalid or missing", + Self::ClosedAccountNumber => { + "Account number specified has been closed on the bank of account's books" + } + Self::ClosedDebtorAccountNumber => "Debtor account number closed", + Self::BlockedAccount => { + "Account specified is blocked, prohibiting posting of transactions against it" + } + Self::ClosedCreditorAccountNumber => "Creditor account number closed", + Self::InvalidBranchCode => "Branch code is invalid or missing", + Self::InvalidAccountCurrency => "Account currency is invalid or missing", + Self::InvalidDebtorAccountCurrency => "Debtor account currency is invalid or missing", + Self::InvalidCreditorAccountCurrency => { + "Creditor account currency is invalid or missing" + } + Self::InvalidAccountType => "Account type missing or invalid", + Self::InvalidDebtorAccountType => "Debtor account type missing or invalid", + Self::InvalidCreditorAccountType => "Creditor account type missing or invalid", + Self::AccountDetailsChanged => "The account details for the counterparty have changed", + Self::CardNumberInvalid => "Credit or debit card number is invalid", + Self::AlreadyExpiredRTP => "Request-to-pay Expiry Date and Time has already passed", + Self::TransactionForbidden => { + "Transaction forbidden on this type of account (formerly NoAgreement)" + } + Self::InvalidBankOperationCode => { + "Bank Operation code specified in the message is not valid for receiver" + } + Self::TransactionNotSupported => { + "Transaction type not supported/authorized on this account" + } + Self::InvalidAgentCountry => "Agent country code is missing or invalid", + Self::InvalidDebtorAgentCountry => "Debtor agent country code is missing or invalid", + Self::InvalidCreditorAgentCountry => { + "Creditor agent country code is missing or invalid" + } + Self::UnsuccesfulDirectDebit => "Debtor account cannot be debited for a generic reason", + Self::InvalidAccessRights => { + "Transaction failed due to invalid or missing user or access right" + } + Self::PaymentNotReceived => "Original payment never received", + Self::AgentSuspended => { + "Agent of message is suspended from the Real Time Payment system" + } + Self::CreditorAgentSuspended => { + "Creditor Agent of message is suspended from the Real Time Payment system" + } + Self::NotAllowedBookTransfer => { + "Payment orders made by transferring funds from one account to another at the same financial institution (bank or payment institution) are not allowed" + } + Self::ForbiddenReturnPayment => { + "Returned payments derived from previously returned transactions are not allowed" + } + Self::IncorrectAgent => "Agent in the payment workflow is incorrect", + Self::AlreadyAcceptedRTP => "Request-to-pay has already been accepted by the Debtor", + Self::ZeroAmount => "Specified message amount is equal to zero", + Self::NotAllowedAmount => { + "Specific transaction/message amount is greater than allowed maximum" + } + Self::NotAllowedCurrency => { + "Specified message amount is an non processable currency outside of existing agreement" + } + Self::InsufficientFunds => { + "Amount of funds available to cover specified message amount is insufficient" + } + Self::Duplication => "Duplication", + Self::TooLowAmount => "Specified transaction amount is less than agreed minimum", + Self::BlockedAmount => { + "Amount specified in message has been blocked by regulatory authorities" + } + Self::WrongAmount => "Amount received is not the amount agreed or expected", + Self::InvalidControlSum => "Sum of instructed amounts does not equal the control sum", + Self::InvalidTransactionCurrency => "Transaction currency is invalid or missing", + Self::InvalidAmount => "Amount is invalid or missing", + Self::AmountExceedsClearingSystemLimit => { + "Transaction amount exceeds limits set by clearing system" + } + Self::AmountExceedsAgreedLimit => { + "Transaction amount exceeds limits agreed between bank and client" + } + Self::AmountBelowClearingSystemMinimum => { + "Transaction amount below minimum set by clearing system" + } + Self::InvalidGroupControlSum => "Control Sum at the Group level is invalid", + Self::InvalidPaymentInfoControlSum => { + "Control Sum at the Payment Information level is invalid" + } + Self::InvalidNumberOfTransactions => "Number of transactions is invalid or missing", + Self::InvalidGroupNumberOfTransactions => { + "Number of transactions at the Group level is invalid or missing" + } + Self::InvalidPaymentInfoNumberOfTransactions => { + "Number of transactions at the Payment Information level is invalid" + } + Self::LimitExceeded => { + "Transaction amount exceeds limits agreed between bank and client" + } + Self::ZeroAmountNotApplied => "Unable to apply zero amount to designated account", + Self::AmountExceedsSettlementLimit => "Transaction amount exceeds settlement limit", + Self::AttachmentMaximumSize => "Size of the attachment exceeds the allowed maximum", + Self::AlreadyPaidRTP => "Request To Pay has already been paid by the Debtor", + Self::AlreadyRefusedRTP => "Request-to-pay has already been refused by the Debtor", + Self::AlreadyRejectedRTP => "Request-to-pay has already been rejected", + Self::AttachementsNotSupported => "Attachments to the request-to-pay are not supported", + Self::NotBusinessDay => "Settlement Cycle Day and Calendar day should be the same", + Self::InconsistenWithEndCustomer => { + "Identification of end customer is not consistent with associated account number" + } + Self::MissingCreditorAddress => { + "Specification of creditor's address, which is required for payment, is missing/not correct (formerly IncorrectCreditorAddress)" + } + Self::UnrecognisedInitiatingParty => { + "Party who initiated the message is not recognised by the end customer" + } + Self::UnknownEndCustomer => { + "End customer specified is not known at associated Sort/National Bank Code or does no longer exist in the books" + } + Self::MissingDebtorAddress => { + "Specification of debtor's address, which is required for payment, is missing/not correct" + } + Self::MissingDebtorName => "Debtor name is missing", + Self::InvalidCountry => "Country code is missing or Invalid", + Self::InvalidDebtorCountry => "Debtor country code is missing or invalid", + Self::InvalidCreditorCountry => "Creditor country code is missing or invalid", + Self::InvalidCountryOfResidence => "Country code of residence is missing or Invalid", + Self::InvalidDebtorCountryOfResidence => { + "Country code of debtor's residence is missing or Invalid" + } + Self::InvalidCreditorCountryOfResidence => { + "Country code of creditor's residence is missing or Invalid" + } + Self::InvalidIdentificationCode => "Identification code missing or invalid", + Self::InvalidDebtorIdentificationCode => { + "Debtor or Ultimate Debtor identification code missing or invalid" + } + Self::InvalidCreditorIdentificationCode => { + "Creditor or Ultimate Creditor identification code missing or invalid" + } + Self::InvalidContactDetails => "Contact details missing or invalid", + Self::InvalidChargeBearerCode => "Charge bearer code for transaction type is invalid", + Self::InvalidNameLength => "Name length exceeds local rules for payment type", + Self::MissingName => "Name missing or invalid", + Self::MissingCreditorName => "Creditor name is missing", + Self::AccountProxyInvalid => { + "Phone number or email address, or any other proxy, used as the account proxy is unknown or invalid" + } + Self::CheckERI => { + "Credit transfer is not tagged as an Extended Remittance Information (ERI) transaction but contains ERI" + } + Self::RequestedExecutionDateOrRequestedCollectionDateTooFarInFuture => { + "Value in Requested Execution Date or Requested Collection Date is too far in the future" + } + Self::RequestedExecutionDateOrRequestedCollectionDateTooFarInPast => { + "Value in Requested Execution Date or Requested Collection Date is too far in the past" + } + Self::ElementIsNotToBeUsedAtBandCLevel => "Element is not to be used at B- and C-Level", + Self::MandateChangesNotAllowed => "Mandate changes are not allowed", + Self::InformationOnMandateChangesMissing => { + "Information on mandate changes are missing" + } + Self::CreditorIdentifierIncorrect => "Value in Creditor Identifier is incorrect", + Self::CreditorIdentifierNotUnambiguouslyAtTransactionLevel => { + "Creditor Identifier is ambiguous at Transaction Level" + } + Self::OriginalDebtorAccountIsNotToBeUsed => "Original Debtor Account is not to be used", + Self::OriginalDebtorAgentIsNotToBeUsed => "Original Debtor Agent is not to be used", + Self::ElementContentIncludesMoreThan140Characters => { + "Content Remittance Information/Structured includes more than 140 characters" + } + Self::ElementContentFormallyIncorrect => "Content is incorrect", + Self::ElementNotAdmitted => "Element is not allowed", + Self::ValuesWillBeSetToNextTARGETday => { + "Values in Interbank Settlement Date or Requested Collection Date will be set to the next TARGET day" + } + Self::DecimalPointsNotCompatibleWithCurrency => { + "Number of decimal points not compatible with the currency" + } + Self::RequiredCompulsoryElementMissing => "Mandatory element is missing", + Self::COREandB2BwithinOnemessage => "SDD CORE and B2B not permitted within one message", + Self::UnacceptedChargeCodeType => { + "Related to a Charge message to convey that the code in Charge Breakdown / Type / Code is not accepted by the receiving party" + } + Self::ChequeSettledOnCreditorAccount => { + "Cheque has been presented in cheque clearing and settled on the creditor’s account" + } + Self::UnderlyingChargeBearerWasNotDebt => { + "Related to a Charge message to convey that the charge bearer code used in the corresponding Payment message was not debt" + } + Self::AuthorisationCancelled => "Authorisation is cancelled", + Self::CreditNotesNotSupported => "Credit notes are not supported", + Self::CreditorBankIsNotRegistered => { + "Creditor bank is not registered under this BIC in the CSM" + } + Self::IncorrectCurrency => "Currency of the payment is incorrect", + Self::RequestedByCustomer => "Cancellation requested by the Debtor", + Self::SettlementNotReceived => { + "Rejection of a payment due to covering FI settlement not being received" + } + Self::DebtorBankIsNotRegistered => { + "Debtor bank is not registered under this BIC in the CSM" + } + Self::ElectronicSignaturesCorrect => "The electronic signature(s) is/are correct", + Self::OrderCancelled => "An authorized user has cancelled the order", + Self::OrderNotCancelled => "The user’s attempt to cancel the order was not successful", + Self::OrderRejected => { + "The order was rejected by the bank side (for reasons concerning content)" + } + Self::OrderForwardedForPostprocessing => { + "The order was correct and could be forwarded for postprocessing" + } + Self::TransferOrder => "The order was transferred to VEU", + Self::ProcessingOK => { + "All actions concerning the order could be done by the EBICS bank server" + } + Self::DecompressionError => "The decompression of the file was not successful", + Self::DecryptionError => "The decryption of the file was not successful", + Self::DataSignRequested => "Data signature is required", + Self::UnknownDataSignFormat => { + "Data signature for the format is not available or invalid" + } + Self::SignerCertificateRevoked => "The signer certificate is revoked", + Self::SignerCertificateNotValid => { + "The signer certificate is not valid (revoked or not active)" + } + Self::IncorrectSignerCertificate => "The signer certificate is not present", + Self::SignerCertificationAuthoritySignerNotValid => { + "The authority of the signer certification sending the certificate is unknown" + } + Self::NotAllowedPayment => "Signer is not allowed to sign this operation type", + Self::NotAllowedAccount => "Signer is not allowed to sign for this account", + Self::NotAllowedNumberOfTransaction => { + "The number of transaction is over the number allowed for this signer" + } + Self::Signer1CertificateRevoked => "The certificate is revoked for the first signer", + Self::Signer1CertificateNotValid => { + "The certificate is not valid (revoked or not active) for the first signer" + } + Self::IncorrectSigner1Certificate => { + "The certificate is not present for the first signer" + } + Self::SignerCertificationAuthoritySigner1NotValid => { + "The authority of signer certification sending the certificate is unknown for the first signer" + } + Self::UserDoesNotExist => "The user is unknown on the server", + Self::IdenticalSignatureFound => "The same signature has already been sent to the bank", + Self::PublicKeyVersionIncorrect => "The public key version is not correct", + Self::DifferentOrderDataInSignatures => "Order data and signatures don’t match", + Self::RepeatOrder => "File cannot be tested, the complete order has to be repeated", + Self::ElectronicSignatureRightsInsufficient => { + "The user’s rights (concerning his signature) are insufficient to execute the order" + } + Self::Signer2CertificateRevoked => "The certificate is revoked for the second signer", + Self::Signer2CertificateNotValid => { + "The certificate is not valid (revoked or not active) for the second signer" + } + Self::IncorrectSigner2Certificate => { + "The certificate is not present for the second signer" + } + Self::SignerCertificationAuthoritySigner2NotValid => { + "The authority of signer certification sending the certificate is unknown for the second signer" + } + Self::WaitingTimeExpired => "Waiting time expired due to incomplete order", + Self::OrderFileDeleted => "The order file was deleted by the bank server", + Self::UserSignedMultipleTimes => "The same user has signed multiple times", + Self::UserNotYetActivated => "The user is not yet activated (technically)", + Self::ReturnForTechnicalReason => "Message routed to the wrong environment", + Self::InvalidDate => "Invalid date (eg, wrong or missing settlement date)", + Self::InvalidCreationDate => { + "Invalid creation date and time in Group Header (eg, historic date)" + } + Self::InvalidNonProcessingDate => { + "Invalid non bank processing date (eg, weekend or local public holiday)" + } + Self::FutureDateNotSupported => "Future date not supported", + Self::InvalidCutOffDate => { + "Associated message, payment information block or transaction was received after agreed processing cut-off date, i" + } + Self::ExecutionDateChanged => { + "Execution Date has been modified in order for transaction to be processed" + } + Self::DuplicateMessageID => "Message Identification is not unique", + Self::DuplicatePaymentInformationID => "Payment Information Block is not unique", + Self::DuplicateTransaction => "Transaction is not unique", + Self::DuplicateEndToEndID => "End To End ID is not unique", + Self::DuplicateInstructionID => "Instruction ID is not unique", + Self::DuplicatePaymentOrCharge => { + "Payment or charge is a duplicate of another payment or charge" + } + Self::CorrespondentBankNotPossible => "Correspondent bank not possible", + Self::BalanceInfoRequest => "Balance of payments complementary info is requested", + Self::SettlementFailed => "Settlement of the transaction has failed", + Self::SettlementSystemNotAvailable => "Interbank settlement system not available", + Self::ExecutionDateNotAccepted => { + "Requested execution date of the payment is not accepted" + } + Self::ExpiryDateTooLong => { + "Expiry date time of the request-to-pay is too far in the future" + } + Self::ExpiryDateTimeReached => { + "Expiry date time of the request-to-pay is already reached" + } + Self::EndOfLife => "Expiration of the payment authorisation due to no use for too long", + Self::ERIOptionNotSupported => { + "Extended Remittance Information (ERI) option is not supported" + } + Self::InvalidFileFormat => "File Format incomplete or invalid", + Self::SyntaxError => { + "Syntax error reason is provided as narrative information in the additional reason information" + } + Self::InvalidPaymentTypeInformation => "Payment Type Information is missing or invalid", + Self::InvalidServiceLevelCode => "Service Level code is missing or invalid", + Self::InvalidLocalInstrumentCode => "Local Instrument code is missing or invalid", + Self::InvalidCategoryPurposeCode => "Category Purpose code is missing or invalid", + Self::InvalidPurpose => "Purpose is missing or invalid", + Self::InvalidEndToEndId => "End to End Id missing or invalid", + Self::InvalidChequeNumber => "Cheque number missing or invalid", + Self::BankSystemProcessingError => { + "File or transaction cannot be processed due to technical issues at the bank side" + } + Self::ClearingRequestAborted => { + "Clearing request rejected due it being subject to an abort operation" + } + Self::OriginalTransactionNotEligibleForRequestedReturn => { + "Original payment is not eligible to be returned given its current status" + } + Self::RequestForCancellationNotFound => "No record of request for cancellation found", + Self::FollowingCancellationRequest => "Return following a cancellation request", + Self::Fraud => "Returned as a result of fraud", + Self::FraudulentOrigin => { + "Cancellation requested following a transaction that was originated fraudulently" + } + Self::PaymentTransferredAndTracked => { + "In an FI To FI Customer Credit Transfer: The Status Originator transferred the payment to the next Agent or to a Market Infrastructure" + } + Self::PaymentTransferredAndNotTracked => { + "In an FI To FI Customer Credit Transfer: The Status Originator transferred the payment to the next Agent or to a Market Infrastructure" + } + Self::CreditDebitNotConfirmed => { + "In a FIToFI Customer Credit Transfer: Credit to the creditor’s account may not be confirmed same day" + } + Self::CreditPendingDocuments => { + "In a FIToFI Customer Credit Transfer: Credit to creditor’s account is pending receipt of required documents" + } + Self::CreditPendingFunds => { + "In a FIToFI Customer Credit Transfer: Credit to the creditor’s account is pending, status Originator is waiting for funds provided via a cover" + } + Self::DeliveredWithServiceLevel => { + "Payment has been delivered to creditor agent with service level" + } + Self::DeliveredWIthoutServiceLevel => { + "Payment has been delivered to creditor agent without service level" + } + Self::CorrespondingOriginalFileStillNotSent => { + "Signature file was sent to the bank but the corresponding original file has not been sent yet" + } + Self::IncorrectExpiryDateTime => "Expiry date time of the request-to-pay is incorrect", + Self::InvalidActivationReference => "Payer’s activation reference is invalid", + Self::InvalidDetails => "Details not valid for this field", + Self::InstalmentPaymentsNotSupported => "Payments in instalments are not supported", + Self::InitialRTPNeverReceived => "No initial request-to-pay has been received", + Self::InvalidSettlementWindow => "Cannot schedule instruction for Night Window", + Self::NoMandate => "No Mandate", + Self::MissingMandatoryInformationInMandate => { + "Mandate related information data required by the scheme is missing" + } + Self::CollectionNotDue => { + "Creditor or creditor's agent should not have collected the direct debit" + } + Self::RefundRequestByEndCustomer => "Return of funds requested by end customer", + Self::EndCustomerDeceased => "End customer is deceased", + Self::MissingInformation => "Information missing for the field or cannot be empty", + Self::NotSpecifiedReasonCustomerGenerated => { + "Reason has not been specified by end customer" + } + Self::NotSpecifiedReasonAgentGenerated => "Reason has not been specified by agent", + Self::Narrative => { + "Reason is provided as narrative information in the additional reason information" + } + Self::NoERI => { + "Credit transfer is tagged as an Extended Remittance Information (ERI) transaction but does not contain ERI" + } + Self::NonAgreedRTP => "No existing agreement for receiving request-to-pay messages", + Self::NoAnswerFromCustomer => "No response from Beneficiary", + Self::NotCompliantGeneric => { + "Customer account is not compliant with regulatory requirements, for example FICA (in South Africa) or any other regulatory requirements which render an account inactive for certain processing" + } + Self::OutstandingFundingForSettlement => { + "Continuous Processing Line on Hold Instruction" + } + Self::NoPaymentGuarantee => { + "Requested payment guarantee (by Creditor) related to a request-to-pay cannot be provided" + } + Self::PayerOrPayerRTPSPNotReachable => { + "Recipient side of the request-to-pay (payer or its request-to-pay service provider) is not reachable" + } + Self::OptionalServiceNotSupported => { + "Requested optional service (for example instalment payments) is not supported" + } + Self::TypeOfPaymentInstrumentNotSupported => { + "Type of payment requested in the request-to-pay is not supported by the payer" + } + Self::PaymentNotAlignedWithRTPRequest => { + "Error code used for RTP-initiated CTR when the pacs" + } + Self::BankIdentifierIncorrect => { + "Bank identifier code specified in the message has an incorrect format (formerly IncorrectFormatForRoutingCode)" + } + Self::InvalidBankIdentifier => "Bank identifier is invalid or missing", + Self::InvalidDebtorBankIdentifier => "Debtor bank identifier is invalid or missing", + Self::InvalidCreditorBankIdentifier => "Creditor bank identifier is invalid or missing", + Self::InvalidBICIdentifier => "BIC identifier is invalid or missing", + Self::InvalidDebtorBICIdentifier => "Debtor BIC identifier is invalid or missing", + Self::InvalidCreditorBICIdentifier => "Creditor BIC identifier is invalid or missing", + Self::InvalidClearingSystemMemberIdentifier => { + "ClearingSystemMemberidentifier is invalid or missing" + } + Self::InvalidDebtorClearingSystemMemberIdentifier => { + "Debtor ClearingSystemMember identifier is invalid or missing" + } + Self::InvalidCreditorClearingSystemMemberIdentifier => { + "Creditor ClearingSystemMember identifier is invalid or missing" + } + Self::InvalidIntermediaryAgent => "Intermediary Agent is invalid or missing", + Self::MissingCreditorSchemeId => "Creditor Scheme Id is invalid or missing", + Self::ParticipantNotAnActiveMemberofRTGS => "Originator not active any more", + Self::ParticipantNotActiveMemberSettlementType => "Settlement agreement required", + Self::ParticipantNotActiveMemberofSADCRTGS => "Participant blocked from SADC-RTGS", + Self::RMessageConflict => "Conflict with R-Message", + Self::ReceiverCustomerInformation => { + "Further information regarding the intended recipient" + } + Self::RTPReceivedCanBeProcessed => { + "Request-to-pay has been received and can be processed further" + } + Self::NotUniqueTransactionReference => { + "Transaction reference is not unique within the message" + } + Self::RequestNotRecognized => { + "Payer did not recognize the request from Payee Participant," + } + Self::MissingDebtorAccountOrIdentification => { + "Specification of the debtor’s account or unique identification needed for reasons of regulatory requirements is insufficient or missing" + } + Self::MissingDebtorNameOrAddress => { + "Specification of the debtor’s name and/or address needed for regulatory requirements is insufficient or missing" + } + Self::MissingCreditorNameOrAddress => { + "Specification of the creditor’s name and/or address needed for regulatory requirements is insufficient or missing" + } + Self::RegulatoryReason => "Regulatory Reason", + Self::RegulatoryInformationInvalid => { + "Regulatory or Central Bank Reporting information missing, incomplete or invalid" + } + Self::TaxInformationInvalid => "Tax information missing, incomplete or invalid", + Self::RemittanceInformationInvalid => { + "Remittance information structure does not comply with rules for payment type" + } + Self::RemittanceInformationTruncated => { + "Remittance information truncated to comply with rules for payment type" + } + Self::InvalidStructuredCreditorReference => { + "Structured creditor reference invalid or missing" + } + Self::InvalidCharacterSet => { + "Character set supplied not valid for the country and payment type" + } + Self::InvalidDebtorAgentServiceID => { + "Invalid or missing identification of a bank proprietary service" + } + Self::InvalidPartyID => { + "Invalid or missing identification required within a particular country or payment type" + } + Self::RTPNotSupportedForDebtor => "Debtor does not support request-to-pay transactions", + Self::ReturnUponUnableToApply => { + "Return following investigation request and no remediation possible" + } + Self::ValidRequestForCancellationAcknowledged => { + "Request for Cancellation is acknowledged following validation" + } + Self::UETRFlaggedForCancellation => { + "Unique End-to-end Transaction Reference (UETR) relating to a payment has been identified as being associated with a Request for Cancellation" + } + Self::NetworkStopOfUETR => { + "Unique End-to-end Transaction Reference (UETR) relating to a payment has been prevent from traveling across a messaging network" + } + Self::RequestForCancellationForwarded => { + "Request for Cancellation has been forwarded to the payment processing/last payment processing agent" + } + Self::RequestForCancellationDeliveryAcknowledgement => { + "Request for Cancellation has been acknowledged as delivered to payment processing/last payment processing agent" + } + Self::SettlementBatchRemovalNotification => { + "Remove Concurrent Batch Processing Line on hold instruction" + } + Self::SpecificServiceOfferedByDebtorAgent => { + "Due to specific service offered by the Debtor Agent" + } + Self::SpecificServiceOfferedByCreditorAgent => { + "Due to specific service offered by the Creditor Agent" + } + Self::ServiceofClearingSystem => { + "Due to a specific service offered by the clearing system" + } + Self::CreditorNotOnWhitelistOfDebtor => { + "Whitelisting service offered by the Debtor Agent; Debtor has not included the Creditor on its “Whitelist” (yet)" + } + Self::CreditorOnBlacklistOfDebtor => { + "Blacklisting service offered by the Debtor Agent; Debtor included the Creditor on his “Blacklist”" + } + Self::MaximumNumberOfDirectDebitTransactionsExceeded => { + "Due to Maximum allowed Direct Debit Transactions per period service offered by the Debtor Agent" + } + Self::MaximumDirectDebitTransactionAmountExceeded => { + "Due to Maximum allowed Direct Debit Transaction amount service offered by the Debtor Agent" + } + Self::MaximumNumberOfCreditTransactionsExceeded => { + "Maximum number of credit transactions allowed by the account servicer per service period exceeded" + } + Self::MaximumCreditTransactionsAmountExceeded => { + "Maximum total credit amount allowed by the account servicer per service period exceeded" + } + Self::DebtorNotOnWhitelistOfCreditorSide => { + "Whitelisting service offered by payment system operator or financial institution" + } + Self::DebtorOnBlacklistOfCreditorSide => { + "Blacklisting service offered by payment system operator or financial institution" + } + Self::ServiceNotRendered => { + "Services are not yet rendered by the Payee Participant (Creditor)" + } + Self::RTPServiceProviderIdentifierIncorrect => { + "Identifier of the request-to-pay service provider is incorrect" + } + Self::TransmissonAborted => { + "The transmission of the file was not successful – it had to be aborted (for technical reasons)" + } + Self::NoDataAvailable => "There is no data available (for download)", + Self::FileNonReadable => "The file cannot be read (e", + Self::IncorrectFileStructure => "The file format is incomplete or invalid", + Self::TokenInvalid => "Token is invalid", + Self::SenderTokenNotFound => "Token used for the sender does not exist", + Self::ReceiverTokenNotFound => "Token used for the receiver does not exist", + Self::TokenMissing => "Token required for request is missing", + Self::TokenCounterpartyMismatch => "Token found with counterparty mismatch", + Self::TokenSingleUse => "Single Use Token already used", + Self::TokenSuspended => "Token found with suspended status", + Self::TokenValueLimitExceeded => "Token found with value limit rule violation", + Self::TokenExpired => "Token expired", + Self::InvalidCutOffTime => { + "Associated message, payment information block, or transaction was received after agreed processing cut-off time" + } + Self::TransmissionSuccessful => { + "The (technical) transmission of the file was successful" + } + Self::TransferToSignByHand => { + "The order was transferred to pass by accompanying note signed by hand" + } + Self::UnknownCreditor => "Unknown Creditor", + Self::UnduePayment => "Payment is not justified", + } + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumString, AsRefStr, Display)] +pub enum ExternalPaymentGroupStatusCode { + /// Settlement on the creditor's account has been completed + #[strum(serialize = "ACCC")] + AcceptedSettlementCompletedCreditorAccount, + /// Preceding check of technical validation was successful + #[strum(serialize = "ACCP")] + AcceptedCustomerProfile, + /// Settlement on the debtor's account has been completed + #[strum(serialize = "ACSC")] + AcceptedSettlementCompletedDebitorAccount, + /// All preceding checks such as technical validation and customer profile were successful and therefore the payment initiation has been accepted for execution + #[strum(serialize = "ACSP")] + AcceptedSettlementInProcess, + /// Authentication and syntactical and semantical validation are successful + #[strum(serialize = "ACTC")] + AcceptedTechnicalValidation, + /// Instruction is accepted but a change will be made, such as date or remittance not sent + #[strum(serialize = "ACWC")] + AcceptedWithChange, + /// A number of transactions have been accepted, whereas another number of transactions have not yet achieved + #[strum(serialize = "PART")] + PartiallyAccepted, + /// Payment initiation or individual transaction included in the payment initiation is pending + #[strum(serialize = "PDNG")] + Pending, + /// Verification of Payee check have been applied to received transactions stating to be complete without mismatching data + #[strum(serialize = "RCVC")] + ReceivedVerificationCompleted, + /// Payment initiation has been received by the receiving agent + #[strum(serialize = "RCVD")] + Received, + /// Payment initiation or individual transaction included in the payment initiation has been rejected + #[strum(serialize = "RJCT")] + Rejected, + /// Verification of Payee checks have been applied to received transactions stating to be complete containing mismatching data + #[strum(serialize = "RVCM")] + ReceivedVerificationCompletedWithMismatches, + /// Verification of party check on transactions received is not yet completed + #[strum(serialize = "RVNC")] + ReceivedVerificationNotCompleted, +} +impl ExternalPaymentGroupStatusCode { + pub fn description(&self) -> &'static str { + match self { + Self::AcceptedSettlementCompletedCreditorAccount => { + "Settlement on the creditor's account has been completed" + } + Self::AcceptedCustomerProfile => { + "Preceding check of technical validation was successful" + } + Self::AcceptedSettlementCompletedDebitorAccount => { + "Settlement on the debtor's account has been completed" + } + Self::AcceptedSettlementInProcess => { + "All preceding checks such as technical validation and customer profile were successful and therefore the payment initiation has been accepted for execution" + } + Self::AcceptedTechnicalValidation => { + "Authentication and syntactical and semantical validation are successful" + } + Self::AcceptedWithChange => { + "Instruction is accepted but a change will be made, such as date or remittance not sent" + } + Self::PartiallyAccepted => { + "A number of transactions have been accepted, whereas another number of transactions have not yet achieved" + } + Self::Pending => { + "Payment initiation or individual transaction included in the payment initiation is pending" + } + Self::ReceivedVerificationCompleted => { + "Verification of Payee check have been applied to received transactions stating to be complete without mismatching data" + } + Self::Received => "Payment initiation has been received by the receiving agent", + Self::Rejected => { + "Payment initiation or individual transaction included in the payment initiation has been rejected" + } + Self::ReceivedVerificationCompletedWithMismatches => { + "Verification of Payee checks have been applied to received transactions stating to be complete containing mismatching data" + } + Self::ReceivedVerificationNotCompleted => { + "Verification of party check on transactions received is not yet completed" + } + } + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumString, AsRefStr, Display)] +pub enum ExternalPaymentTransactionStatusCode { + /// Settlement on the creditor's account has been completed + #[strum(serialize = "ACCC")] + AcceptedSettlementCompletedCreditorAccount, + /// Preceding check of technical validation was successful + #[strum(serialize = "ACCP")] + AcceptedCustomerProfile, + /// Preceding check of technical validation and customer profile was successful and an automatic funds check was positive + #[strum(serialize = "ACFC")] + AcceptedFundsChecked, + /// Preceding check of technical validation and customer profile was successful, and an automatic funds check was positive, but an explicit confirmation by the initiating party is outstanding + #[strum(serialize = "ACFW")] + AcceptedFundsCheckedWaitingConfirmation, + /// Payment instruction to issue a cheque has been accepted, and the cheque has been issued but not yet been deposited or cleared + #[strum(serialize = "ACIS")] + AcceptedandChequeIssued, + /// Status of transaction released from the Debtor Agent and accepted by the clearing + #[strum(serialize = "ACPD")] + AcceptedClearingProcessed, + /// Settlement completed + #[strum(serialize = "ACSC")] + AcceptedSettlementCompletedDebitorAccount, + /// All preceding checks such as technical validation and customer profile were successful and therefore the payment instruction has been accepted for execution + #[strum(serialize = "ACSP")] + AcceptedSettlementInProcess, + /// Authentication and syntactical and semantical validation are successful + #[strum(serialize = "ACTC")] + AcceptedTechnicalValidation, + /// Instruction is accepted but a change will be made, such as date or remittance not sent + #[strum(serialize = "ACWC")] + AcceptedWithChange, + /// Payment instruction included in the credit transfer is accepted without being posted to the creditor customer’s account + #[strum(serialize = "ACWP")] + AcceptedWithoutPosting, + /// Payment transaction previously reported with status 'ACWP' is blocked, for example, funds will neither be posted to the Creditor's account, nor be returned to the Debtor + #[strum(serialize = "BLCK")] + Blocked, + /// Payment initiation has been successfully cancelled after having received a request for cancellation + #[strum(serialize = "CANC")] + Cancelled, + /// Cash has been picked up by the Creditor + #[strum(serialize = "CPUC")] + CashPickedUpByCreditor, + /// Payment initiation needs multiple authentications, where some but not yet all have been performed + #[strum(serialize = "PATC")] + PartiallyAcceptedTechnicalCorrect, + /// Payment instruction is pending + #[strum(serialize = "PDNG")] + Pending, + /// Request for Payment has been presented to the Debtor + #[strum(serialize = "PRES")] + Presented, + /// Verification of Payee check has been applied to received transaction stating to be complete without mismatching data + #[strum(serialize = "RCVC")] + ReceivedVerificationCompleted, + /// Payment instruction has been received + #[strum(serialize = "RCVD")] + Received, + /// Payment instruction has been rejected + #[strum(serialize = "RJCT")] + Rejected, + /// Verification of Payee checks have been applied to received transaction stating to be completed containing mismatching data + #[strum(serialize = "RVCM")] + ReceivedVerificationCompletedWithMismatches, + /// Verification of Payee check has been applied to received transaction stating to be complete with data matching closely + #[strum(serialize = "RVMC")] + ReceivedVerificationCompletedMatchClosely, + /// Verification of Payee check has been applied to received transaction stating to be complete with not applicable data + #[strum(serialize = "RVNA")] + ReceivedVerificationCompletedNotApplicable, + /// Verification of party check on the transaction is not yet completed + #[strum(serialize = "RVNC")] + ReceivedVerificationNotCompleted, + /// Verification of Payee check has been applied to received transaction stating to be complete with mismatching data + #[strum(serialize = "RVNM")] + ReceivedVerificationCompletedNoMatch, +} +impl ExternalPaymentTransactionStatusCode { + pub fn description(&self) -> &'static str { + match self { + Self::AcceptedSettlementCompletedCreditorAccount => { + "Settlement on the creditor's account has been completed" + } + Self::AcceptedCustomerProfile => { + "Preceding check of technical validation was successful" + } + Self::AcceptedFundsChecked => { + "Preceding check of technical validation and customer profile was successful and an automatic funds check was positive" + } + Self::AcceptedFundsCheckedWaitingConfirmation => { + "Preceding check of technical validation and customer profile was successful, and an automatic funds check was positive, but an explicit confirmation by the initiating party is outstanding" + } + Self::AcceptedandChequeIssued => { + "Payment instruction to issue a cheque has been accepted, and the cheque has been issued but not yet been deposited or cleared" + } + Self::AcceptedClearingProcessed => { + "Status of transaction released from the Debtor Agent and accepted by the clearing" + } + Self::AcceptedSettlementCompletedDebitorAccount => "Settlement completed", + Self::AcceptedSettlementInProcess => { + "All preceding checks such as technical validation and customer profile were successful and therefore the payment instruction has been accepted for execution" + } + Self::AcceptedTechnicalValidation => { + "Authentication and syntactical and semantical validation are successful" + } + Self::AcceptedWithChange => { + "Instruction is accepted but a change will be made, such as date or remittance not sent" + } + Self::AcceptedWithoutPosting => { + "Payment instruction included in the credit transfer is accepted without being posted to the creditor customer’s account" + } + Self::Blocked => { + "Payment transaction previously reported with status 'ACWP' is blocked, for example, funds will neither be posted to the Creditor's account, nor be returned to the Debtor" + } + Self::Cancelled => { + "Payment initiation has been successfully cancelled after having received a request for cancellation" + } + Self::CashPickedUpByCreditor => "Cash has been picked up by the Creditor", + Self::PartiallyAcceptedTechnicalCorrect => { + "Payment initiation needs multiple authentications, where some but not yet all have been performed" + } + Self::Pending => "Payment instruction is pending", + Self::Presented => "Request for Payment has been presented to the Debtor", + Self::ReceivedVerificationCompleted => { + "Verification of Payee check has been applied to received transaction stating to be complete without mismatching data" + } + Self::Received => "Payment instruction has been received", + Self::Rejected => "Payment instruction has been rejected", + Self::ReceivedVerificationCompletedWithMismatches => { + "Verification of Payee checks have been applied to received transaction stating to be completed containing mismatching data" + } + Self::ReceivedVerificationCompletedMatchClosely => { + "Verification of Payee check has been applied to received transaction stating to be complete with data matching closely" + } + Self::ReceivedVerificationCompletedNotApplicable => { + "Verification of Payee check has been applied to received transaction stating to be complete with not applicable data" + } + Self::ReceivedVerificationNotCompleted => { + "Verification of party check on the transaction is not yet completed" + } + Self::ReceivedVerificationCompletedNoMatch => { + "Verification of Payee check has been applied to received transaction stating to be complete with mismatching data" + } + } + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumString, AsRefStr, Display)] +pub enum ExternalReturnReasonCode { + /// Format of the account number specified is not correct + #[strum(serialize = "AC01")] + IncorrectAccountNumber, + /// Debtor account number invalid or missing + #[strum(serialize = "AC02")] + InvalidDebtorAccountNumber, + /// Wrong IBAN in SCT + #[strum(serialize = "AC03")] + InvalidCreditorAccountNumber, + /// Account number specified has been closed on the bank of account's books + #[strum(serialize = "AC04")] + ClosedAccountNumber, + /// Account specified is blocked, prohibiting posting of transactions against it + #[strum(serialize = "AC06")] + BlockedAccount, + /// Creditor account number closed + #[strum(serialize = "AC07")] + ClosedCreditorAccountNumber, + /// Debtor account type is missing or invalid + #[strum(serialize = "AC13")] + InvalidDebtorAccountType, + /// An agent in the payment chain is invalid + #[strum(serialize = "AC14")] + InvalidAgent, + /// Account details have changed + #[strum(serialize = "AC15")] + AccountDetailsChanged, + /// Account is in sequestration + #[strum(serialize = "AC16")] + AccountInSequestration, + /// Account is in liquidation + #[strum(serialize = "AC17")] + AccountInLiquidation, + /// Transaction forbidden on this type of account (formerly NoAgreement) + #[strum(serialize = "AG01")] + TransactionForbidden, + /// Bank Operation code specified in the message is not valid for receiver + #[strum(serialize = "AG02")] + InvalidBankOperationCode, + /// Debtor account cannot be debited for a generic reason + #[strum(serialize = "AG07")] + UnsuccesfulDirectDebit, + /// Agent in the payment workflow is incorrect + #[strum(serialize = "AGNT")] + IncorrectAgent, + /// Specified message amount is equal to zero + #[strum(serialize = "AM01")] + ZeroAmount, + /// Specific transaction/message amount is greater than allowed maximum + #[strum(serialize = "AM02")] + NotAllowedAmount, + /// Specified message amount is an non processable currency outside of existing agreement + #[strum(serialize = "AM03")] + NotAllowedCurrency, + /// Amount of funds available to cover specified message amount is insufficient + #[strum(serialize = "AM04")] + InsufficientFunds, + /// Duplication + #[strum(serialize = "AM05")] + Duplication, + /// Specified transaction amount is less than agreed minimum + #[strum(serialize = "AM06")] + TooLowAmount, + /// Amount specified in message has been blocked by regulatory authorities + #[strum(serialize = "AM07")] + BlockedAmount, + /// Amount received is not the amount agreed or expected + #[strum(serialize = "AM09")] + WrongAmount, + /// Sum of instructed amounts does not equal the control sum + #[strum(serialize = "AM10")] + InvalidControlSum, + /// Already returned original SCT + #[strum(serialize = "ARDT")] + AlreadyReturnedTransaction, + /// Identification of end customer is not consistent with associated account number, organisation ID or private ID + #[strum(serialize = "BE01")] + InconsistenWithEndCustomer, + /// Specification of creditor's address, which is required for payment, is missing/not correct (formerly IncorrectCreditorAddress) + #[strum(serialize = "BE04")] + MissingCreditorAddress, + /// Party who initiated the message is not recognised by the end customer + #[strum(serialize = "BE05")] + UnrecognisedInitiatingParty, + /// End customer specified is not known at associated Sort/National Bank Code or does no longer exist in the books + #[strum(serialize = "BE06")] + UnknownEndCustomer, + /// Specification of debtor's address, which is required for payment, is missing/not correct + #[strum(serialize = "BE07")] + MissingDebtorAddress, + /// Returned as a result of a bank error + #[strum(serialize = "BE08")] + BankError, + /// Debtor country code is missing or invalid + #[strum(serialize = "BE10")] + InvalidDebtorCountry, + /// Creditor country code is missing or invalid + #[strum(serialize = "BE11")] + InvalidCreditorCountry, + /// Debtor or Ultimate Debtor identification code missing or invalid + #[strum(serialize = "BE16")] + InvalidDebtorIdentificationCode, + /// Creditor or Ultimate Creditor identification code missing or invalid + #[strum(serialize = "BE17")] + InvalidCreditorIdentificationCode, + /// Authorisation is cancelled + #[strum(serialize = "CN01")] + AuthorisationCancelled, + /// Creditor bank is not registered under this BIC in the CSM + #[strum(serialize = "CNOR")] + CreditorBankIsNotRegistered, + /// Cash not picked up by Creditor or cash could not be delivered to Creditor + #[strum(serialize = "CNPC")] + CashNotPickedUp, + /// Currency of the payment is incorrect + #[strum(serialize = "CURR")] + IncorrectCurrency, + /// Cancellation requested by the Debtor + #[strum(serialize = "CUST")] + RequestedByCustomer, + /// Return of Covering Settlement due to the underlying Credit Transfer details not being received + #[strum(serialize = "DC04")] + NoCustomerCreditTransferReceived, + /// Debtor bank is not registered under this BIC in the CSM + #[strum(serialize = "DNOR")] + DebtorBankIsNotRegistered, + /// Return following technical problems resulting in erroneous transaction + #[strum(serialize = "DS28")] + ReturnForTechnicalReason, + /// Invalid date (eg, wrong settlement date) + #[strum(serialize = "DT01")] + InvalidDate, + /// Cheque has been issued but not deposited and is considered expired + #[strum(serialize = "DT02")] + ChequeExpired, + /// Future date not supported + #[strum(serialize = "DT04")] + FutureDateNotSupported, + /// Payment is a duplicate of another payment + #[strum(serialize = "DUPL")] + DuplicatePayment, + /// Correspondent bank not possible + #[strum(serialize = "ED01")] + CorrespondentBankNotPossible, + /// Balance of payments complementary info is requested + #[strum(serialize = "ED03")] + BalanceInfoRequest, + /// Settlement of the transaction has failed + #[strum(serialize = "ED05")] + SettlementFailed, + /// The card payment is fraudulent and was not processed with EMV technology for an EMV card + #[strum(serialize = "EMVL")] + EMVLiabilityShift, + /// The Extended Remittance Information (ERI) option is not supported + #[strum(serialize = "ERIN")] + ERIOptionNotSupported, + /// Payment Type Information is missing or invalid + #[strum(serialize = "FF03")] + InvalidPaymentTypeInformation, + /// Service Level code is missing or invalid + #[strum(serialize = "FF04")] + InvalidServiceLevelCode, + /// Local Instrument code is missing or invalid + #[strum(serialize = "FF05")] + InvalidLocalInstrumentCode, + /// Category Purpose code is missing or invalid + #[strum(serialize = "FF06")] + InvalidCategoryPurposeCode, + /// Purpose is missing or invalid + #[strum(serialize = "FF07")] + InvalidPurpose, + /// Return following a cancellation request + #[strum(serialize = "FOCR")] + FollowingCancellationRequest, + /// Returned as a result of fraud + #[strum(serialize = "FR01")] + Fraud, + /// Final response/tracking is recalled as mandate is cancelled + #[strum(serialize = "FRTR")] + FinalResponseMandateCancelled, + /// In a FIToFI Customer Credit Transfer: Credit to the creditor’s account is pending, status Originator is waiting for funds provided via a cover + #[strum(serialize = "G004")] + CreditPendingFunds, + /// No Mandate + #[strum(serialize = "MD01")] + NoMandate, + /// Mandate related information data required by the scheme is missing + #[strum(serialize = "MD02")] + MissingMandatoryInformationInMandate, + /// Creditor or creditor's agent should not have collected the direct debit + #[strum(serialize = "MD05")] + CollectionNotDue, + /// Return of funds requested by end customer + #[strum(serialize = "MD06")] + RefundRequestByEndCustomer, + /// End customer is deceased + #[strum(serialize = "MD07")] + EndCustomerDeceased, + /// Reason has not been specified by end customer + #[strum(serialize = "MS02")] + NotSpecifiedReasonCustomerGenerated, + /// Reason has not been specified by agent + #[strum(serialize = "MS03")] + NotSpecifiedReasonAgentGenerated, + /// Reason is provided as narrative information in the additional reason information + #[strum(serialize = "NARR")] + Narrative, + /// No response from Beneficiary + #[strum(serialize = "NOAS")] + NoAnswerFromCustomer, + /// Customer account is not compliant with regulatory requirements, for example FICA (in South Africa) or any other regulatory requirements which render an account inactive for certain processing + #[strum(serialize = "NOCM")] + NotCompliant, + /// Original SCT never received + #[strum(serialize = "NOOR")] + NoOriginalTransactionReceived, + /// The card payment is fraudulent (lost and stolen fraud) and was processed as EMV transaction without PIN verification + #[strum(serialize = "PINL")] + PINLiabilityShift, + /// Bank Identifier code specified in the message has an incorrect format (formerly IncorrectFormatForRoutingCode) + #[strum(serialize = "RC01")] + BankIdentifierIncorrect, + /// Debtor bank identifier is invalid or missing + #[strum(serialize = "RC03")] + InvalidDebtorBankIdentifier, + /// Creditor bank identifier is invalid or missing + #[strum(serialize = "RC04")] + InvalidCreditorBankIdentifier, + /// Incorrrect BIC of the beneficiary Bank in the SCTR + #[strum(serialize = "RC07")] + InvalidCreditorBICIdentifier, + /// ClearingSystemMemberidentifier is invalid or missing + #[strum(serialize = "RC08")] + InvalidClearingSystemMemberIdentifier, + /// Intermediary Agent is invalid or missing + #[strum(serialize = "RC11")] + InvalidIntermediaryAgent, + /// Transaction reference is not unique within the message + #[strum(serialize = "RF01")] + NotUniqueTransactionReference, + /// Specification of the debtor’s account or unique identification needed for reasons of regulatory requirements is insufficient or missing + #[strum(serialize = "RR01")] + MissingDebtorAccountOrIdentification, + /// Specification of the debtor’s name and/or address needed for regulatory requirements is insufficient or missing + #[strum(serialize = "RR02")] + MissingDebtorNameOrAddress, + /// Specification of the creditor’s name and/or address needed for regulatory requirements is insufficient or missing + #[strum(serialize = "RR03")] + MissingCreditorNameOrAddress, + /// Regulatory Reason + #[strum(serialize = "RR04")] + RegulatoryReason, + /// Regulatory or Central Bank Reporting information missing, incomplete or invalid + #[strum(serialize = "RR05")] + RegulatoryInformationInvalid, + /// Tax information missing, incomplete or invalid + #[strum(serialize = "RR06")] + TaxInformationInvalid, + /// Remittance information structure does not comply with rules for payment type + #[strum(serialize = "RR07")] + RemittanceInformationInvalid, + /// Remittance information truncated to comply with rules for payment type + #[strum(serialize = "RR08")] + RemittanceInformationTruncated, + /// Structured creditor reference invalid or missing + #[strum(serialize = "RR09")] + InvalidStructuredCreditorReference, + /// Invalid or missing identification of a bank proprietary service + #[strum(serialize = "RR11")] + InvalidDebtorAgentServiceIdentification, + /// Invalid or missing identification required within a particular country or payment type + #[strum(serialize = "RR12")] + InvalidPartyIdentification, + /// Return following investigation request and no remediation possible + #[strum(serialize = "RUTA")] + ReturnUponUnableToApply, + /// Due to specific service offered by the Debtor Agent + #[strum(serialize = "SL01")] + SpecificServiceOfferedByDebtorAgent, + /// Due to specific service offered by the Creditor Agent + #[strum(serialize = "SL02")] + SpecificServiceOfferedByCreditorAgent, + /// Whitelisting service offered by the Debtor Agent; Debtor has not included the Creditor on its “Whitelist” (yet) + #[strum(serialize = "SL11")] + CreditorNotOnWhitelistOfDebtor, + /// Blacklisting service offered by the Debtor Agent; Debtor included the Creditor on his “Blacklist” + #[strum(serialize = "SL12")] + CreditorOnBlacklistOfDebtor, + /// Due to Maximum allowed Direct Debit Transactions per period service offered by the Debtor Agent + #[strum(serialize = "SL13")] + MaximumNumberOfDirectDebitTransactionsExceeded, + /// Due to Maximum allowed Direct Debit Transaction amount service offered by the Debtor Agent + #[strum(serialize = "SL14")] + MaximumDirectDebitTransactionAmountExceeded, + /// Payment is stopped by account holder + #[strum(serialize = "SP01")] + PaymentStopped, + /// Previously stopped by means of a stop payment advise + #[strum(serialize = "SP02")] + PreviouslyStopped, + /// The card payment is returned since a cash amount rendered was not correct or goods or a service was not rendered to the customer, e + #[strum(serialize = "SVNR")] + ServiceNotRendered, + /// Associated message was received after agreed processing cut-off time + #[strum(serialize = "TM01")] + CutOffTime, + /// Return following direct debit being removed from tracking process + #[strum(serialize = "TRAC")] + RemovedFromTracking, + /// Payment is not justified + #[strum(serialize = "UPAY")] + UnduePayment, +} +impl ExternalReturnReasonCode { + pub fn description(&self) -> &'static str { + match self { + Self::IncorrectAccountNumber => "Format of the account number specified is not correct", + Self::InvalidDebtorAccountNumber => "Debtor account number invalid or missing", + Self::InvalidCreditorAccountNumber => "Wrong IBAN in SCT", + Self::ClosedAccountNumber => { + "Account number specified has been closed on the bank of account's books" + } + Self::BlockedAccount => { + "Account specified is blocked, prohibiting posting of transactions against it" + } + Self::ClosedCreditorAccountNumber => "Creditor account number closed", + Self::InvalidDebtorAccountType => "Debtor account type is missing or invalid", + Self::InvalidAgent => "An agent in the payment chain is invalid", + Self::AccountDetailsChanged => "Account details have changed", + Self::AccountInSequestration => "Account is in sequestration", + Self::AccountInLiquidation => "Account is in liquidation", + Self::TransactionForbidden => { + "Transaction forbidden on this type of account (formerly NoAgreement)" + } + Self::InvalidBankOperationCode => { + "Bank Operation code specified in the message is not valid for receiver" + } + Self::UnsuccesfulDirectDebit => "Debtor account cannot be debited for a generic reason", + Self::IncorrectAgent => "Agent in the payment workflow is incorrect", + Self::ZeroAmount => "Specified message amount is equal to zero", + Self::NotAllowedAmount => { + "Specific transaction/message amount is greater than allowed maximum" + } + Self::NotAllowedCurrency => { + "Specified message amount is an non processable currency outside of existing agreement" + } + Self::InsufficientFunds => { + "Amount of funds available to cover specified message amount is insufficient" + } + Self::Duplication => "Duplication", + Self::TooLowAmount => "Specified transaction amount is less than agreed minimum", + Self::BlockedAmount => { + "Amount specified in message has been blocked by regulatory authorities" + } + Self::WrongAmount => "Amount received is not the amount agreed or expected", + Self::InvalidControlSum => "Sum of instructed amounts does not equal the control sum", + Self::AlreadyReturnedTransaction => "Already returned original SCT", + Self::InconsistenWithEndCustomer => { + "Identification of end customer is not consistent with associated account number, organisation ID or private ID" + } + Self::MissingCreditorAddress => { + "Specification of creditor's address, which is required for payment, is missing/not correct (formerly IncorrectCreditorAddress)" + } + Self::UnrecognisedInitiatingParty => { + "Party who initiated the message is not recognised by the end customer" + } + Self::UnknownEndCustomer => { + "End customer specified is not known at associated Sort/National Bank Code or does no longer exist in the books" + } + Self::MissingDebtorAddress => { + "Specification of debtor's address, which is required for payment, is missing/not correct" + } + Self::BankError => "Returned as a result of a bank error", + Self::InvalidDebtorCountry => "Debtor country code is missing or invalid", + Self::InvalidCreditorCountry => "Creditor country code is missing or invalid", + Self::InvalidDebtorIdentificationCode => { + "Debtor or Ultimate Debtor identification code missing or invalid" + } + Self::InvalidCreditorIdentificationCode => { + "Creditor or Ultimate Creditor identification code missing or invalid" + } + Self::AuthorisationCancelled => "Authorisation is cancelled", + Self::CreditorBankIsNotRegistered => { + "Creditor bank is not registered under this BIC in the CSM" + } + Self::CashNotPickedUp => { + "Cash not picked up by Creditor or cash could not be delivered to Creditor" + } + Self::IncorrectCurrency => "Currency of the payment is incorrect", + Self::RequestedByCustomer => "Cancellation requested by the Debtor", + Self::NoCustomerCreditTransferReceived => { + "Return of Covering Settlement due to the underlying Credit Transfer details not being received" + } + Self::DebtorBankIsNotRegistered => { + "Debtor bank is not registered under this BIC in the CSM" + } + Self::ReturnForTechnicalReason => { + "Return following technical problems resulting in erroneous transaction" + } + Self::InvalidDate => "Invalid date (eg, wrong settlement date)", + Self::ChequeExpired => { + "Cheque has been issued but not deposited and is considered expired" + } + Self::FutureDateNotSupported => "Future date not supported", + Self::DuplicatePayment => "Payment is a duplicate of another payment", + Self::CorrespondentBankNotPossible => "Correspondent bank not possible", + Self::BalanceInfoRequest => "Balance of payments complementary info is requested", + Self::SettlementFailed => "Settlement of the transaction has failed", + Self::EMVLiabilityShift => { + "The card payment is fraudulent and was not processed with EMV technology for an EMV card" + } + Self::ERIOptionNotSupported => { + "The Extended Remittance Information (ERI) option is not supported" + } + Self::InvalidPaymentTypeInformation => "Payment Type Information is missing or invalid", + Self::InvalidServiceLevelCode => "Service Level code is missing or invalid", + Self::InvalidLocalInstrumentCode => "Local Instrument code is missing or invalid", + Self::InvalidCategoryPurposeCode => "Category Purpose code is missing or invalid", + Self::InvalidPurpose => "Purpose is missing or invalid", + Self::FollowingCancellationRequest => "Return following a cancellation request", + Self::Fraud => "Returned as a result of fraud", + Self::FinalResponseMandateCancelled => { + "Final response/tracking is recalled as mandate is cancelled" + } + Self::CreditPendingFunds => { + "In a FIToFI Customer Credit Transfer: Credit to the creditor’s account is pending, status Originator is waiting for funds provided via a cover" + } + Self::NoMandate => "No Mandate", + Self::MissingMandatoryInformationInMandate => { + "Mandate related information data required by the scheme is missing" + } + Self::CollectionNotDue => { + "Creditor or creditor's agent should not have collected the direct debit" + } + Self::RefundRequestByEndCustomer => "Return of funds requested by end customer", + Self::EndCustomerDeceased => "End customer is deceased", + Self::NotSpecifiedReasonCustomerGenerated => { + "Reason has not been specified by end customer" + } + Self::NotSpecifiedReasonAgentGenerated => "Reason has not been specified by agent", + Self::Narrative => { + "Reason is provided as narrative information in the additional reason information" + } + Self::NoAnswerFromCustomer => "No response from Beneficiary", + Self::NotCompliant => { + "Customer account is not compliant with regulatory requirements, for example FICA (in South Africa) or any other regulatory requirements which render an account inactive for certain processing" + } + Self::NoOriginalTransactionReceived => "Original SCT never received", + Self::PINLiabilityShift => { + "The card payment is fraudulent (lost and stolen fraud) and was processed as EMV transaction without PIN verification" + } + Self::BankIdentifierIncorrect => { + "Bank Identifier code specified in the message has an incorrect format (formerly IncorrectFormatForRoutingCode)" + } + Self::InvalidDebtorBankIdentifier => "Debtor bank identifier is invalid or missing", + Self::InvalidCreditorBankIdentifier => "Creditor bank identifier is invalid or missing", + Self::InvalidCreditorBICIdentifier => { + "Incorrrect BIC of the beneficiary Bank in the SCTR" + } + Self::InvalidClearingSystemMemberIdentifier => { + "ClearingSystemMemberidentifier is invalid or missing" + } + Self::InvalidIntermediaryAgent => "Intermediary Agent is invalid or missing", + Self::NotUniqueTransactionReference => { + "Transaction reference is not unique within the message" + } + Self::MissingDebtorAccountOrIdentification => { + "Specification of the debtor’s account or unique identification needed for reasons of regulatory requirements is insufficient or missing" + } + Self::MissingDebtorNameOrAddress => { + "Specification of the debtor’s name and/or address needed for regulatory requirements is insufficient or missing" + } + Self::MissingCreditorNameOrAddress => { + "Specification of the creditor’s name and/or address needed for regulatory requirements is insufficient or missing" + } + Self::RegulatoryReason => "Regulatory Reason", + Self::RegulatoryInformationInvalid => { + "Regulatory or Central Bank Reporting information missing, incomplete or invalid" + } + Self::TaxInformationInvalid => "Tax information missing, incomplete or invalid", + Self::RemittanceInformationInvalid => { + "Remittance information structure does not comply with rules for payment type" + } + Self::RemittanceInformationTruncated => { + "Remittance information truncated to comply with rules for payment type" + } + Self::InvalidStructuredCreditorReference => { + "Structured creditor reference invalid or missing" + } + Self::InvalidDebtorAgentServiceIdentification => { + "Invalid or missing identification of a bank proprietary service" + } + Self::InvalidPartyIdentification => { + "Invalid or missing identification required within a particular country or payment type" + } + Self::ReturnUponUnableToApply => { + "Return following investigation request and no remediation possible" + } + Self::SpecificServiceOfferedByDebtorAgent => { + "Due to specific service offered by the Debtor Agent" + } + Self::SpecificServiceOfferedByCreditorAgent => { + "Due to specific service offered by the Creditor Agent" + } + Self::CreditorNotOnWhitelistOfDebtor => { + "Whitelisting service offered by the Debtor Agent; Debtor has not included the Creditor on its “Whitelist” (yet)" + } + Self::CreditorOnBlacklistOfDebtor => { + "Blacklisting service offered by the Debtor Agent; Debtor included the Creditor on his “Blacklist”" + } + Self::MaximumNumberOfDirectDebitTransactionsExceeded => { + "Due to Maximum allowed Direct Debit Transactions per period service offered by the Debtor Agent" + } + Self::MaximumDirectDebitTransactionAmountExceeded => { + "Due to Maximum allowed Direct Debit Transaction amount service offered by the Debtor Agent" + } + Self::PaymentStopped => "Payment is stopped by account holder", + Self::PreviouslyStopped => "Previously stopped by means of a stop payment advise", + Self::ServiceNotRendered => { + "The card payment is returned since a cash amount rendered was not correct or goods or a service was not rendered to the customer, e" + } + Self::CutOffTime => { + "Associated message was received after agreed processing cut-off time" + } + Self::RemovedFromTracking => { + "Return following direct debit being removed from tracking process" + } + Self::UnduePayment => "Payment is not justified", + } + } +} diff --git a/src/iso20022/mod.rs b/src/iso20022/mod.rs @@ -0,0 +1,21 @@ +/* +* This file is part of LibEuFin. +* Copyright (C) 2026 Taler Systems S.A. + +* LibEuFin is free software; you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License as +* published by the Free Software Foundation; either version 3, or +* (at your option) any later version. + +* LibEuFin is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General +* Public License for more details. + +* You should have received a copy of the GNU Affero General Public +* License along with LibEuFin; see the file COPYING. If not, see +* <http://www.gnu.org/licenses/> +*/ + +pub mod bank_tx_code; +pub mod external_code; diff --git a/src/lib.rs b/src/lib.rs @@ -45,6 +45,7 @@ pub mod config; pub mod crypto; pub mod db; pub mod ebics_code; +pub mod iso20022; pub mod key_management; pub mod keys; pub mod model;