-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2155898
commit c76d233
Showing
3 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Date;Valuta;Amount;Currency;Creditor Name;Creditor IBAN;Debtor Name;Debtor IBAN;Transaction Type;Description | ||
2023-12-31;2023-12-31;-1500.00;EUR;AMAZON EU S.A R.L., NIEDERLASSUNG DEUTSCHLAND;DE80 1000 0000 2222 2222 22;Andreas Mausch;DE29 1008 9999 9999 9999 99;FOLGELASTSCHRIFT;123-4567890-1234567 Amazon.de TR25F7LEK7KAKRQA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.052.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:camt.052.001.02 camt.052.001.02.xsd"> | ||
<BkToCstmrAcctRpt> | ||
<GrpHdr> | ||
<MsgId>camt52_20231231205959__ONLINEBA</MsgId> | ||
<CreDtTm>2023-12-31T20:59:59+01:00</CreDtTm> | ||
<MsgPgntn> | ||
<PgNb>1</PgNb> | ||
<LastPgInd>true</LastPgInd> | ||
</MsgPgntn> | ||
</GrpHdr> | ||
<Rpt> | ||
<Id>camt052_ONLINEBA</Id> | ||
<ElctrncSeqNb>00000</ElctrncSeqNb> | ||
<CreDtTm>2023-12-31T20:59:59+01:00</CreDtTm> | ||
<Acct> | ||
<Id> | ||
<IBAN>DE29100899999999999999</IBAN> | ||
</Id> | ||
<Ccy>EUR</Ccy> | ||
<Svcr> | ||
<FinInstnId> | ||
<BIC>HASPDEHHXXX</BIC> | ||
<Nm>Hamburger Sparkasse</Nm> | ||
<Othr> | ||
<Id>DE999888777</Id> | ||
<Issr>UmsStId</Issr> | ||
</Othr> | ||
</FinInstnId> | ||
</Svcr> | ||
</Acct> | ||
<Bal> | ||
<Tp> | ||
<CdOrPrtry> | ||
<Cd>PRCD</Cd> | ||
</CdOrPrtry> | ||
</Tp> | ||
<Amt Ccy="EUR">20000.00</Amt> | ||
<CdtDbtInd>CRDT</CdtDbtInd> | ||
<Dt> | ||
<Dt>2023-12-01</Dt> | ||
</Dt> | ||
</Bal> | ||
<Bal> | ||
<Tp> | ||
<CdOrPrtry> | ||
<Cd>CLBD</Cd> | ||
</CdOrPrtry> | ||
</Tp> | ||
<Amt Ccy="EUR">18500.00</Amt> | ||
<CdtDbtInd>CRDT</CdtDbtInd> | ||
<Dt> | ||
<Dt>2023-12-31</Dt> | ||
</Dt> | ||
</Bal> | ||
<Ntry> | ||
<Amt Ccy="EUR">1500.00</Amt> | ||
<CdtDbtInd>DBIT</CdtDbtInd> | ||
<Sts>BOOK</Sts> | ||
<BookgDt> | ||
<Dt>2023-12-31</Dt> | ||
</BookgDt> | ||
<ValDt> | ||
<Dt>2023-12-31</Dt> | ||
</ValDt> | ||
<AcctSvcrRef>NONREF</AcctSvcrRef> | ||
<BkTxCd/> | ||
<NtryDtls> | ||
<TxDtls> | ||
<Refs> | ||
<EndToEndId>TR25F7LEK7KAKRQA</EndToEndId> | ||
<MndtId>Q1.1ke32hq7c0h0wb3kd.gpfskhjrk</MndtId> | ||
<Prtry> | ||
<Tp>FI-UMSATZ-ID</Tp> | ||
<Ref>2023-12-31-04.07.56.123456</Ref> | ||
</Prtry> | ||
</Refs> | ||
<BkTxCd> | ||
<Prtry> | ||
<Cd>NDDT+123+45678+123</Cd> | ||
<Issr>DK</Issr> | ||
</Prtry> | ||
</BkTxCd> | ||
<RltdPties> | ||
<Dbtr> | ||
<Nm>Andreas Mausch</Nm> | ||
</Dbtr> | ||
<DbtrAcct> | ||
<Id> | ||
<IBAN>DE29100899999999999999</IBAN> | ||
</Id> | ||
</DbtrAcct> | ||
<Cdtr> | ||
<Nm>AMAZON EU S.A R.L., NIEDERLASSUNG DEUTSCHLAND</Nm> | ||
<Id> | ||
<PrvtId> | ||
<Othr> | ||
<Id>DE30100000001111111111</Id> | ||
</Othr> | ||
</PrvtId> | ||
</Id> | ||
</Cdtr> | ||
<CdtrAcct> | ||
<Id> | ||
<IBAN>DE80100000002222222222</IBAN> | ||
</Id> | ||
</CdtrAcct> | ||
</RltdPties> | ||
<RltdAgts> | ||
<DbtrAgt> | ||
<FinInstnId> | ||
<BIC>HASPDEHH</BIC> | ||
</FinInstnId> | ||
</DbtrAgt> | ||
<CdtrAgt> | ||
<FinInstnId> | ||
<BIC>MARKDEF1100</BIC> | ||
</FinInstnId> | ||
</CdtrAgt> | ||
</RltdAgts> | ||
<RmtInf> | ||
<Ustrd>123-4567890-1234567 Amazon.de TR25F7LEK7KAKRQA</Ustrd> | ||
</RmtInf> | ||
</TxDtls> | ||
</NtryDtls> | ||
<AddtlNtryInf>FOLGELASTSCHRIFT</AddtlNtryInf> | ||
</Ntry> | ||
</Rpt> | ||
</BkToCstmrAcctRpt> | ||
</Document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use std::io::Write; | ||
use std::str::from_utf8; | ||
|
||
use haspa_camt052_to_csv::Format::Csv; | ||
use haspa_camt052_to_csv::process; | ||
|
||
#[test] | ||
fn test_add() { | ||
let mut buf = Vec::new(); | ||
{ | ||
let mut x: Box<dyn Write> = Box::new(&mut buf); | ||
process(vec!["./tests/camt052.xml".to_string()], Csv, &mut x).unwrap(); | ||
} | ||
|
||
let expected_output = std::fs::read_to_string("./tests/camt052.csv").unwrap(); | ||
assert_eq!(from_utf8(&buf).unwrap(), expected_output, "CSV Output"); | ||
} |