diff --git a/lib/sepa.js b/lib/sepa.ts similarity index 99% rename from lib/sepa.js rename to lib/sepa.ts index a2ebc94..b095618 100644 --- a/lib/sepa.js +++ b/lib/sepa.ts @@ -62,8 +62,9 @@ } function getPainXMLVersion(painFormat) { + // 008 is the version by default. var inc = painFormat.indexOf('pain.008') === 0 ? 1 : 0; - return parseInt(painFormat.substr(-2), 10) + inc; + return parseInt(painFormat.substr(2), 10) + inc; } function SepaDocument(painFormat, options) {