https://github.com/pierrickp/sepa-xml-2
https://github.com/pierrickp/sepa-xml-2
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/pierrickp/sepa-xml-2
- Owner: PierrickP
- Created: 2016-03-15T11:07:26.000Z (over 10 years ago)
- Default Branch: v2
- Last Pushed: 2016-03-15T12:58:25.000Z (over 10 years ago)
- Last Synced: 2024-04-15T14:25:00.261Z (over 2 years ago)
- Language: JavaScript
- Size: 238 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SEPA-XML-2
[](https://travis-ci.org/PierrickP/sepa-xml-2)
[](https://coveralls.io/github/PierrickP/sepa-xml-2?branch=master)
Based on https://github.com/mgmco/sepa-xml this NPM module generate SEPA XML file for **credit** (ask me for *debit*)
## Changes from the original module
+ Implemente `pain.001.001.03` & `pain.001.001.02`
+ Allow creating multiple instances
+ Multi *payment* blocs
+ Validations
## Usage
### Credit
```javascript
var SepaXML = require('sepa-xml');
var credit = SepaXML.createCredit(); // takes a single argument which is the version, default is 'pain.001.001.03'
// This sets the header data in the file
credit.setHeaderInfo({
id: '123/1',
method: 'TRF',
batchBooking: false
});
// Create payment batch
var payment = new credit.createPayment({
id: 'XYZ987',
method: 'TRF'
});
// Add transaction
payment.addTransaction({
id: 'endToEndID',
iban: 'NL21ABNA0531621583',
name: 'generateiban',
amount: 42
});
// add payment to credit
credit.addPayment(payment);
credit.compile(function (err, out) {
// your XML data gets output here
});
```