-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiso_export.py
More file actions
73 lines (70 loc) · 1.74 KB
/
iso_export.py
File metadata and controls
73 lines (70 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from datetime import datetime
def generate_iso_xml(wallet_address):
now = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S")
xml_template = f"""<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
<CstmrCdtTrfInitn>
<GrpHdr>
<MsgId>ADC-{wallet_address[:6]}</MsgId>
<CreDtTm>{now}</CreDtTm>
<NbOfTxs>1</NbOfTxs>
<CtrlSum>0</CtrlSum>
<InitgPty>
<Nm>ADC CryptoGuard</Nm>
</InitgPty>
</GrpHdr>
<PmtInf>
<PmtInfId>Payment-{wallet_address[:6]}</PmtInfId>
<PmtMtd>TRF</PmtMtd>
<BtchBookg>false</BtchBookg>
<NbOfTxs>1</NbOfTxs>
<CtrlSum>0</CtrlSum>
<PmtTpInf>
<InstrPrty>NORM</InstrPrty>
<SvcLvl>
<Cd>SEPA</Cd>
</SvcLvl>
</PmtTpInf>
<ReqdExctnDt>{now[:10]}</ReqdExctnDt>
<Dbtr>
<Nm>{wallet_address}</Nm>
</Dbtr>
<DbtrAcct>
<Id>
<Othr>
<Id>{wallet_address}</Id>
</Othr>
</Id>
</DbtrAcct>
<DbtrAgt>
<FinInstnId>
<BIC>ADCOINMYKL</BIC>
</FinInstnId>
</DbtrAgt>
<CdtTrfTxInf>
<PmtId>
<EndToEndId>TX-{wallet_address[:8]}</EndToEndId>
</PmtId>
<Amt>
<InstdAmt Ccy="USD">0.00</InstdAmt>
</Amt>
<CdtrAgt>
<FinInstnId>
<BIC>ADCOINMYKL</BIC>
</FinInstnId>
</CdtrAgt>
<Cdtr>
<Nm>Blockchain Wallet</Nm>
</Cdtr>
<CdtrAcct>
<Id>
<Othr>
<Id>{wallet_address}</Id>
</Othr>
</Id>
</CdtrAcct>
</CdtTrfTxInf>
</PmtInf>
</CstmrCdtTrfInitn>
</Document>"""
return xml_template