npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sepa-xml-maker

v1.1.3

Published

Generador de archivos SEPA en XML compatible con ISO20022

Downloads

179

Readme

sepa-xml-maker

Overview

The SEPA XML MAKER is a Node.js module designed for creating SEPA Direct Debit files in ISO20022 XML format. This module is ideal for automating payments across Europe, providing a simple and efficient way to generate compliant XML files for bank transactions.

Key Features

  • ISO20022 Compliance: Generates XML files that comply with the ISO20022 standard for direct debit transactions.
  • Flexible Configuration: Easily customize transaction details, creditor information, and message headers.
  • Batch Processing: Generate XML for multiple transactions in one go.
  • Error Handling: Built-in mechanisms to handle errors and invalid inputs.

Installation

To install the Direct Debit XML Generator, run the following command in your terminal:

npm i sepa-xml-maker

Usage

Import the generateXML function in your Node.js project

const generateXML = require('sepa-xml-maker');

Example

Here's how to generate an XML file:

const generateXML = require('sepa-xml-maker');

const transactions = [
    {
        endToEndId: "1",
        currency: "EUR",
        amount: "250.00",
        mandateId: "5678",
        mandateDate: "2024-11-02",
        creditorId: "ES1234567890", // Example NIF
        bic: "BANCOEXAMPLEXXX",
        debtorName: "Alice Example",
        debtorIBAN: "ES9121000418450200051332", // Example IBAN
        reference: "EXAMPLECORP - SUBSCRIPTION"
    },
    // Add more transactions as needed
];

const data = {
    msgId: "EXAMPLE CORP 2024-11",
    total: transactions.length,
    totalCuotas: "250.00",
    orgId: "ES1234567890", // Example NIF
    iban: "ES9121000418450200051332", // Example IBAN
    bic: "BANCOEXAMPLEXXX"
};

const xmlContent = generateXML(transactions, data);

Parameters

The generateXML function takes two parameters:

  • transactions (Array): An array of objects, each containing:

    • endToEndId (string): Unique transaction ID.
    • currency (string): Currency code (e.g., "EUR").
    • amount (string): Transaction amount.
    • mandateId (string): Mandate ID.
    • mandateDate (string): Date of mandate signature in YYYY-MM-DD format.
    • creditorId (string): Creditor's unique identification number.
    • bic (string): Bank Identifier Code (BIC) of the debtor's bank.
    • debtorName (string): Name of the debtor.
    • debtorIBAN (string): IBAN of the debtor's account.
    • reference (string): Payment reference or description.
  • data (Object): Contains general information for the SEPA file:

    • msgId (string): Unique message ID.
    • total (number): Total number of transactions.
    • totalCuotas (string): Total sum of the transaction amounts.
    • orgId (string): Organization ID (e.g., NIF or CIF for Spain).
    • iban (string): Creditor's IBAN.
    • bic (string): Creditor's BIC.

Output

The generateXML function returns a formatted XML string in ISO20022 format. You can save this XML string as a .xml file or process it further as needed.

Example Output

Here’s a snippet of the XML output:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02">
  <CstmrDrctDbtInitn>
    <GrpHdr>
      <MsgId>EXAMPLE CORP 2024-11</MsgId>
      <CreDtTm>2024-11-05T20:01:11</CreDtTm>
      <NbOfTxs>1</NbOfTxs>
      <CtrlSum>250.00</CtrlSum>
      <InitgPty>
        <Nm>EXAMPLE CORP 2024-11</Nm>
        <Id>
          <OrgId>
            <Othr>
              <Id>ES1234567890</Id>
            </Othr>
          </OrgId>
        </Id>
      </InitgPty>
    </GrpHdr>
    <PmtInf>
      <PmtInfId>1</PmtInfId>
      <PmtMtd>DD</PmtMtd>
      <CtrlSum>250.00</CtrlSum>
      <PmtTpInf>
        <SvcLvl>
          <Cd>SEPA</Cd>
        </SvcLvl>
        <LclInstrm>
          <Cd>CORE</Cd>
        </LclInstrm>
        <SeqTp>RCUR</SeqTp>
      </PmtTpInf>
      <ReqdColltnDt>2024-11-05</ReqdColltnDt>
      <Cdtr>
        <Nm>EXAMPLE CORP 2024-11</Nm>
      </Cdtr>
      <CdtrAcct>
        <Id>
          <IBAN>ES9121000418450200051332</IBAN>
        </Id>
      </CdtrAcct>
      <CdtrAgt>
        <FinInstnId>
          <BIC>BANCOEXAMPLEXXX</BIC>
        </FinInstnId>
      </CdtrAgt>
      <ChrgBr>SLEV</ChrgBr>
      <DrctDbtTxInf>
        <PmtId>
          <EndToEndId>1</EndToEndId>
        </PmtId>
        <InstdAmt Ccy="EUR">250.00</InstdAmt>
        <DrctDbtTx>
          <MndtRltdInf>
            <MndtId>5678</MndtId>
            <DtOfSgntr>2024-11-02</DtOfSgntr>
          </MndtRltdInf>
          <CdtrSchmeId>
            <Id>
              <PrvtId>
                <Othr>
                  <Id>ES1234567890</Id>
                  <SchmeNm>
                    <Prtry>SEPA</Prtry>
                  </SchmeNm>
                </Othr>
              </PrvtId>
            </Id>
          </CdtrSchmeId>
        </DrctDbtTx>
        <DbtrAgt>
          <FinInstnId>
            <BIC>BANCOEXAMPLEXXX</BIC>
          </FinInstnId>
        </DbtrAgt>
        <Dbtr>
          <Nm>Alice Example</Nm>
        </Dbtr>
        <DbtrAcct>
          <Id>
            <IBAN>ES9121000418450200051332</IBAN>
          </Id>
        </DbtrAcct>
        <Purp>
          <Cd>COMC</Cd>
        </Purp>
        <RmtInf>
          <Ustrd>EXAMPLECORP - SUBSCRIPTION</Ustrd>
        </RmtInf>
      </DrctDbtTxInf>
    </PmtInf>
  </CstmrDrctDbtInitn>
</Document>