Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ node_modules
*.log
.DS_Store
coverage
package-lock.json
package-lock.json
11 changes: 7 additions & 4 deletions formats/pain.001.001.02.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02 pain.001.001.02.xsd">
<Document xmlns="{{_header.xmlNamespace}}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="{{_header.xmlSchemaLocation}}">
<pain.001.001.02>
<GrpHdr>
<MsgId>{{_header.messageId}}</MsgId>
Expand All @@ -15,11 +15,13 @@
<PmtInf>
<PmtInfId>{{_payments.info.id}}</PmtInfId>
<PmtMtd>{{_payments.info.method}}</PmtMtd>
{{#if _payments.info.serviceLevel}}
<PmtTpInf>
<SvcLvl>
<Cd>SEPA</Cd>
<Cd>{{_payments.info.serviceLevel}}</Cd>
</SvcLvl>
</PmtTpInf>
{{/if}}
<ReqdExctnDt>{{formatDate _payments.info.when}}</ReqdExctnDt>
<Dbtr>
<Nm>{{_payments.info.senderName}}</Nm>
Expand All @@ -28,7 +30,7 @@
<Id>
<IBAN>{{_payments.info.senderIBAN}}</IBAN>
</Id>
<Ccy>EUR</Ccy>
<Ccy>{{_payments.info.currency}}</Ccy>
</DbtrAcct>
{{#if _payments.info.bic}}
<DbtrAgt>
Expand All @@ -40,10 +42,11 @@
{{#each _payments.transactions}}
<CdtTrfTxInf>
<PmtId>
<InstrId>{{endToEndId}}</InstrId>
<EndToEndId>{{endToEndId}}</EndToEndId>
</PmtId>
<Amt>
<InstdAmt Ccy="EUR">{{amount}}</InstdAmt>
<InstdAmt Ccy="{{../_payments.info.currency}}">{{amount}}</InstdAmt>
</Amt>
{{#if bic}}
<CdtrAgt>
Expand Down
9 changes: 6 additions & 3 deletions formats/pain.001.001.03.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03 pain.001.001.03.xsd">
<Document xmlns="{{_header.xmlNamespace}}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="{{_header.xmlSchemaLocation}}">
<CstmrCdtTrfInitn>
<GrpHdr>
<MsgId>{{_header.messageId}}</MsgId>
Expand All @@ -25,11 +25,13 @@
<BtchBookg>{{_payments.info.batchBooking}}</BtchBookg>
<NbOfTxs>{{_payments.info.transactionCount}}</NbOfTxs>
<CtrlSum>{{_payments.info.transactionControlSum}}</CtrlSum>
{{#if _payments.info.serviceLevel}}
<PmtTpInf>
<SvcLvl>
<Cd>SEPA</Cd>
<Cd>{{_payments.info.serviceLevel}}</Cd>
</SvcLvl>
</PmtTpInf>
{{/if}}
<ReqdExctnDt>{{formatDate _payments.info.when}}</ReqdExctnDt>
<Dbtr>
<Nm>{{_payments.info.senderName}}</Nm>
Expand All @@ -49,10 +51,11 @@
{{#each _payments.transactions}}
<CdtTrfTxInf>
<PmtId>
<InstrId>{{endToEndId}}</InstrId>
<EndToEndId>{{endToEndId}}</EndToEndId>
</PmtId>
<Amt>
<InstdAmt Ccy="EUR">{{amount}}</InstdAmt>
<InstdAmt Ccy="{{../_payments.info.currency}}">{{amount}}</InstdAmt>
</Amt>
{{#if bic}}
<CdtrAgt>
Expand Down
8 changes: 6 additions & 2 deletions lib/sepa-xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,19 @@ function SepaXML(format) {
this.outputFormat = format || 'pain.001.001.03';

this._header = {
xmlNamespace: 'urn:iso:std:iso:20022:tech:xsd:pain.001.001.02',
xmlSchemaLocation: 'urn:iso:std:iso:20022:tech:xsd:pain.001.001.02 pain.001.001.02.xsd',
messageId: null,
initiator: null
initiator: null,
serviceLevel: undefined
};

this._payments = {
info: {
id: null,
method: null,
batchBooking: false
batchBooking: false,
currency: null
},

transactions: []
Expand Down