@davidvornholt/lib-fints 0.0.0-stage → 1.5.401
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FORK.md +40 -0
- package/LICENSE +504 -0
- package/README.md +423 -2
- package/biome.json +35 -0
- package/dist/accountBalance.js +1 -0
- package/dist/accountDescriptor.js +65 -0
- package/dist/bankAccount.js +42 -0
- package/dist/bankAnswer.js +1 -0
- package/dist/bankTransaction.js +1 -0
- package/dist/bankingInformation.js +1 -0
- package/dist/bpd.js +1 -0
- package/dist/camtParser.js +443 -0
- package/dist/client.js +740 -0
- package/dist/codes.js +87 -0
- package/dist/config.js +241 -0
- package/dist/creditCardStatement.js +1 -0
- package/dist/dataElements/AlphaNumeric.js +24 -0
- package/dist/dataElements/Amount.js +6 -0
- package/dist/dataElements/Binary.js +37 -0
- package/dist/dataElements/Country.js +6 -0
- package/dist/dataElements/Currency.js +6 -0
- package/dist/dataElements/Dat.js +18 -0
- package/dist/dataElements/DataElement.js +38 -0
- package/dist/dataElements/Digits.js +23 -0
- package/dist/dataElements/Float.js +21 -0
- package/dist/dataElements/Identification.js +6 -0
- package/dist/dataElements/Numeric.js +26 -0
- package/dist/dataElements/Text.js +21 -0
- package/dist/dataElements/Time.js +18 -0
- package/dist/dataElements/YesNo.js +18 -0
- package/dist/dataGroups/Account.js +12 -0
- package/dist/dataGroups/Balance.js +15 -0
- package/dist/dataGroups/BankIdentification.js +8 -0
- package/dist/dataGroups/DataGroup.js +61 -0
- package/dist/dataGroups/InternationalAccount.js +15 -0
- package/dist/dataGroups/Money.js +8 -0
- package/dist/dataGroups/RefMessage.js +8 -0
- package/dist/dataGroups/SepaAccount.js +17 -0
- package/dist/dataGroups/TimeStamp.js +8 -0
- package/dist/decoder.js +100 -0
- package/dist/dialog.js +469 -0
- package/dist/electronicStatement.js +1 -0
- package/dist/encoder.js +59 -0
- package/dist/format.js +6 -0
- package/dist/httpClient.js +84 -0
- package/dist/index.js +22 -0
- package/dist/interactions/balanceInteraction.js +46 -0
- package/dist/interactions/creditTransferInteraction.js +499 -0
- package/dist/interactions/creditcardStatementInteraction.js +115 -0
- package/dist/interactions/creditcardStatementInteractionHKKKU.js +141 -0
- package/dist/interactions/customerInteraction.js +121 -0
- package/dist/interactions/electronicStatementInteraction.js +89 -0
- package/dist/interactions/endDialogInteraction.js +17 -0
- package/dist/interactions/initDialogInteraction.js +232 -0
- package/dist/interactions/portfolioInteraction.js +65 -0
- package/dist/interactions/sepaAccountInteraction.js +51 -0
- package/dist/interactions/statementInteractionCAMT.js +71 -0
- package/dist/interactions/statementInteractionMT940.js +50 -0
- package/dist/interactions/tanMediaInteraction.js +37 -0
- package/dist/interactions/transferOutcome.js +364 -0
- package/dist/interactions/vopCheck.js +346 -0
- package/dist/message.js +239 -0
- package/dist/mt535parser.js +151 -0
- package/dist/mt940parser.js +313 -0
- package/dist/pain001Builder.js +308 -0
- package/dist/pain002Parser.js +140 -0
- package/dist/parser.js +28 -0
- package/dist/partedSegment.js +11 -0
- package/dist/segment.js +81 -0
- package/dist/segmentDefinition.js +20 -0
- package/dist/segmentHeader.js +13 -0
- package/dist/segments/DIKKU.js +23 -0
- package/dist/segments/DKKKU.js +25 -0
- package/dist/segments/HIBPA.js +26 -0
- package/dist/segments/HICAZ.js +22 -0
- package/dist/segments/HICAZS.js +19 -0
- package/dist/segments/HICCSS.js +23 -0
- package/dist/segments/HIEKA.js +45 -0
- package/dist/segments/HIEKAS.js +18 -0
- package/dist/segments/HIKAZ.js +16 -0
- package/dist/segments/HIKAZS.js +17 -0
- package/dist/segments/HIKIM.js +14 -0
- package/dist/segments/HIKKU.js +23 -0
- package/dist/segments/HIKKUS.js +18 -0
- package/dist/segments/HIKOM.js +26 -0
- package/dist/segments/HIPINS.js +22 -0
- package/dist/segments/HIRMG.js +23 -0
- package/dist/segments/HIRMS.js +23 -0
- package/dist/segments/HISAL.js +34 -0
- package/dist/segments/HISPA.js +14 -0
- package/dist/segments/HISPAS.js +22 -0
- package/dist/segments/HISYN.js +19 -0
- package/dist/segments/HITAB.js +40 -0
- package/dist/segments/HITAN.js +25 -0
- package/dist/segments/HITANS.js +53 -0
- package/dist/segments/HIUPA.js +21 -0
- package/dist/segments/HIUPD.js +41 -0
- package/dist/segments/HIVPAS.js +21 -0
- package/dist/segments/HIVPP.js +35 -0
- package/dist/segments/HIVPPS.js +23 -0
- package/dist/segments/HIWPD.js +15 -0
- package/dist/segments/HKCAZ.js +28 -0
- package/dist/segments/HKCCS.js +30 -0
- package/dist/segments/HKEKA.js +43 -0
- package/dist/segments/HKEND.js +14 -0
- package/dist/segments/HKIDN.js +21 -0
- package/dist/segments/HKKAZ.js +27 -0
- package/dist/segments/HKKKU.js +26 -0
- package/dist/segments/HKSAL.js +24 -0
- package/dist/segments/HKSPA.js +21 -0
- package/dist/segments/HKSYN.js +14 -0
- package/dist/segments/HKTAB.js +15 -0
- package/dist/segments/HKTAN.js +38 -0
- package/dist/segments/HKVPA.js +19 -0
- package/dist/segments/HKVPP.js +33 -0
- package/dist/segments/HKVVB.js +21 -0
- package/dist/segments/HKWPD.js +23 -0
- package/dist/segments/HNHBK.js +23 -0
- package/dist/segments/HNHBS.js +14 -0
- package/dist/segments/HNSHA.js +20 -0
- package/dist/segments/HNSHK.js +54 -0
- package/dist/segments/HNVSD.js +14 -0
- package/dist/segments/HNVSK.js +52 -0
- package/dist/segments/businessTransactionParameter.js +20 -0
- package/dist/segments/registry.js +120 -0
- package/dist/statement.js +1 -0
- package/dist/tanMethod.js +1 -0
- package/dist/tests/HIBPA.test.js +26 -0
- package/dist/tests/HICAZS.test.js +18 -0
- package/dist/tests/HICCSS.test.js +16 -0
- package/dist/tests/HIPINS.test.js +14 -0
- package/dist/tests/HIRMG.test.js +24 -0
- package/dist/tests/HITAB.test.js +26 -0
- package/dist/tests/HITANS.test.js +19 -0
- package/dist/tests/HIUPA.test.js +11 -0
- package/dist/tests/HIUPD.test.js +11 -0
- package/dist/tests/HIVPAS.test.js +16 -0
- package/dist/tests/HIVPP.test.js +58 -0
- package/dist/tests/HIVPPS.test.js +29 -0
- package/dist/tests/HIWPD.test.js +25 -0
- package/dist/tests/HKCAZ.test.js +43 -0
- package/dist/tests/HKCCS.test.js +52 -0
- package/dist/tests/HKEKA.test.js +198 -0
- package/dist/tests/HKIDN.test.js +22 -0
- package/dist/tests/HKKKU.test.js +207 -0
- package/dist/tests/HKSAL.test.js +45 -0
- package/dist/tests/HKTAN.test.js +22 -0
- package/dist/tests/HKVPA.test.js +21 -0
- package/dist/tests/HKVPP.test.js +40 -0
- package/dist/tests/HKWPD.test.js +38 -0
- package/dist/tests/HNSHK.test.js +11 -0
- package/dist/tests/HNVSK.test.js +11 -0
- package/dist/tests/accountDescriptor.test.js +99 -0
- package/dist/tests/accountReference.test.js +126 -0
- package/dist/tests/bankReplyChecks.test.js +37 -0
- package/dist/tests/camtParser.test.js +988 -0
- package/dist/tests/client.test.js +690 -0
- package/dist/tests/credentialRedaction.test.js +59 -0
- package/dist/tests/creditTransfer.test.js +1475 -0
- package/dist/tests/creditTransferBank.js +205 -0
- package/dist/tests/creditTransferSafety.test.js +319 -0
- package/dist/tests/datatypes.test.js +8 -0
- package/dist/tests/dialog.test.js +435 -0
- package/dist/tests/httpClientErrorLog.test.js +27 -0
- package/dist/tests/interactionAccountDescriptor.test.js +153 -0
- package/dist/tests/message.test.js +98 -0
- package/dist/tests/mt535parser.test.js +245 -0
- package/dist/tests/mt940parser.test.js +82 -0
- package/dist/tests/pain001Builder.test.js +291 -0
- package/dist/tests/pain002Parser.test.js +152 -0
- package/dist/tests/parser.test.js +25 -0
- package/dist/tests/partedDialog.test.js +203 -0
- package/dist/tests/partedResponse.test.js +181 -0
- package/dist/tests/statementParseFailure.test.js +18 -0
- package/dist/tests/tanMedia.test.js +125 -0
- package/dist/types/accountBalance.d.ts +9 -0
- package/dist/types/accountBalance.d.ts.map +1 -0
- package/dist/types/accountDescriptor.d.ts +49 -0
- package/dist/types/accountDescriptor.d.ts.map +1 -0
- package/dist/types/bankAccount.d.ts +39 -0
- package/dist/types/bankAccount.d.ts.map +1 -0
- package/dist/types/bankAnswer.d.ts +6 -0
- package/dist/types/bankAnswer.d.ts.map +1 -0
- package/dist/types/bankTransaction.d.ts +22 -0
- package/dist/types/bankTransaction.d.ts.map +1 -0
- package/dist/types/bankingInformation.d.ts +20 -0
- package/dist/types/bankingInformation.d.ts.map +1 -0
- package/dist/types/bpd.d.ts +17 -0
- package/dist/types/bpd.d.ts.map +1 -0
- package/dist/types/camtParser.d.ts +31 -0
- package/dist/types/camtParser.d.ts.map +1 -0
- package/dist/types/client.d.ts +302 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/codes.d.ts +75 -0
- package/dist/types/codes.d.ts.map +1 -0
- package/dist/types/config.d.ts +127 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/creditCardStatement.d.ts +16 -0
- package/dist/types/creditCardStatement.d.ts.map +1 -0
- package/dist/types/dataElements/AlphaNumeric.d.ts +8 -0
- package/dist/types/dataElements/AlphaNumeric.d.ts.map +1 -0
- package/dist/types/dataElements/Amount.d.ts +5 -0
- package/dist/types/dataElements/Amount.d.ts.map +1 -0
- package/dist/types/dataElements/Binary.d.ts +15 -0
- package/dist/types/dataElements/Binary.d.ts.map +1 -0
- package/dist/types/dataElements/Country.d.ts +5 -0
- package/dist/types/dataElements/Country.d.ts.map +1 -0
- package/dist/types/dataElements/Currency.d.ts +5 -0
- package/dist/types/dataElements/Currency.d.ts.map +1 -0
- package/dist/types/dataElements/Dat.d.ts +8 -0
- package/dist/types/dataElements/Dat.d.ts.map +1 -0
- package/dist/types/dataElements/DataElement.d.ts +14 -0
- package/dist/types/dataElements/DataElement.d.ts.map +1 -0
- package/dist/types/dataElements/Digits.d.ts +8 -0
- package/dist/types/dataElements/Digits.d.ts.map +1 -0
- package/dist/types/dataElements/Float.d.ts +8 -0
- package/dist/types/dataElements/Float.d.ts.map +1 -0
- package/dist/types/dataElements/Identification.d.ts +5 -0
- package/dist/types/dataElements/Identification.d.ts.map +1 -0
- package/dist/types/dataElements/Numeric.d.ts +9 -0
- package/dist/types/dataElements/Numeric.d.ts.map +1 -0
- package/dist/types/dataElements/Text.d.ts +8 -0
- package/dist/types/dataElements/Text.d.ts.map +1 -0
- package/dist/types/dataElements/Time.d.ts +8 -0
- package/dist/types/dataElements/Time.d.ts.map +1 -0
- package/dist/types/dataElements/YesNo.d.ts +7 -0
- package/dist/types/dataElements/YesNo.d.ts.map +1 -0
- package/dist/types/dataGroups/Account.d.ts +14 -0
- package/dist/types/dataGroups/Account.d.ts.map +1 -0
- package/dist/types/dataGroups/Balance.d.ts +12 -0
- package/dist/types/dataGroups/Balance.d.ts.map +1 -0
- package/dist/types/dataGroups/BankIdentification.d.ts +5 -0
- package/dist/types/dataGroups/BankIdentification.d.ts.map +1 -0
- package/dist/types/dataGroups/DataGroup.d.ts +10 -0
- package/dist/types/dataGroups/DataGroup.d.ts.map +1 -0
- package/dist/types/dataGroups/InternationalAccount.d.ts +13 -0
- package/dist/types/dataGroups/InternationalAccount.d.ts.map +1 -0
- package/dist/types/dataGroups/Money.d.ts +9 -0
- package/dist/types/dataGroups/Money.d.ts.map +1 -0
- package/dist/types/dataGroups/RefMessage.d.ts +9 -0
- package/dist/types/dataGroups/RefMessage.d.ts.map +1 -0
- package/dist/types/dataGroups/SepaAccount.d.ts +11 -0
- package/dist/types/dataGroups/SepaAccount.d.ts.map +1 -0
- package/dist/types/dataGroups/TimeStamp.d.ts +9 -0
- package/dist/types/dataGroups/TimeStamp.d.ts.map +1 -0
- package/dist/types/decoder.d.ts +4 -0
- package/dist/types/decoder.d.ts.map +1 -0
- package/dist/types/dialog.d.ts +106 -0
- package/dist/types/dialog.d.ts.map +1 -0
- package/dist/types/electronicStatement.d.ts +40 -0
- package/dist/types/electronicStatement.d.ts.map +1 -0
- package/dist/types/encoder.d.ts +3 -0
- package/dist/types/encoder.d.ts.map +1 -0
- package/dist/types/format.d.ts +3 -0
- package/dist/types/format.d.ts.map +1 -0
- package/dist/types/httpClient.d.ts +14 -0
- package/dist/types/httpClient.d.ts.map +1 -0
- package/dist/types/index.d.ts +27 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/interactions/balanceInteraction.d.ts +16 -0
- package/dist/types/interactions/balanceInteraction.d.ts.map +1 -0
- package/dist/types/interactions/creditTransferInteraction.d.ts +228 -0
- package/dist/types/interactions/creditTransferInteraction.d.ts.map +1 -0
- package/dist/types/interactions/creditcardStatementInteraction.d.ts +19 -0
- package/dist/types/interactions/creditcardStatementInteraction.d.ts.map +1 -0
- package/dist/types/interactions/creditcardStatementInteractionHKKKU.d.ts +23 -0
- package/dist/types/interactions/creditcardStatementInteractionHKKKU.d.ts.map +1 -0
- package/dist/types/interactions/customerInteraction.d.ts +84 -0
- package/dist/types/interactions/customerInteraction.d.ts.map +1 -0
- package/dist/types/interactions/electronicStatementInteraction.d.ts +34 -0
- package/dist/types/interactions/electronicStatementInteraction.d.ts.map +1 -0
- package/dist/types/interactions/endDialogInteraction.d.ts +13 -0
- package/dist/types/interactions/endDialogInteraction.d.ts.map +1 -0
- package/dist/types/interactions/initDialogInteraction.d.ts +23 -0
- package/dist/types/interactions/initDialogInteraction.d.ts.map +1 -0
- package/dist/types/interactions/portfolioInteraction.d.ts +40 -0
- package/dist/types/interactions/portfolioInteraction.d.ts.map +1 -0
- package/dist/types/interactions/sepaAccountInteraction.d.ts +18 -0
- package/dist/types/interactions/sepaAccountInteraction.d.ts.map +1 -0
- package/dist/types/interactions/statementInteractionCAMT.d.ts +14 -0
- package/dist/types/interactions/statementInteractionCAMT.d.ts.map +1 -0
- package/dist/types/interactions/statementInteractionMT940.d.ts +14 -0
- package/dist/types/interactions/statementInteractionMT940.d.ts.map +1 -0
- package/dist/types/interactions/tanMediaInteraction.d.ts +13 -0
- package/dist/types/interactions/tanMediaInteraction.d.ts.map +1 -0
- package/dist/types/interactions/transferOutcome.d.ts +129 -0
- package/dist/types/interactions/transferOutcome.d.ts.map +1 -0
- package/dist/types/interactions/vopCheck.d.ts +107 -0
- package/dist/types/interactions/vopCheck.d.ts.map +1 -0
- package/dist/types/message.d.ts +30 -0
- package/dist/types/message.d.ts.map +1 -0
- package/dist/types/mt535parser.d.ts +23 -0
- package/dist/types/mt535parser.d.ts.map +1 -0
- package/dist/types/mt940parser.d.ts +46 -0
- package/dist/types/mt940parser.d.ts.map +1 -0
- package/dist/types/pain001Builder.d.ts +96 -0
- package/dist/types/pain001Builder.d.ts.map +1 -0
- package/dist/types/pain002Parser.d.ts +77 -0
- package/dist/types/pain002Parser.d.ts.map +1 -0
- package/dist/types/parser.d.ts +2 -0
- package/dist/types/parser.d.ts.map +1 -0
- package/dist/types/partedSegment.d.ts +15 -0
- package/dist/types/partedSegment.d.ts.map +1 -0
- package/dist/types/segment.d.ts +11 -0
- package/dist/types/segment.d.ts.map +1 -0
- package/dist/types/segmentDefinition.d.ts +13 -0
- package/dist/types/segmentDefinition.d.ts.map +1 -0
- package/dist/types/segmentHeader.d.ts +11 -0
- package/dist/types/segmentHeader.d.ts.map +1 -0
- package/dist/types/segments/DIKKU.d.ts +20 -0
- package/dist/types/segments/DIKKU.d.ts.map +1 -0
- package/dist/types/segments/DKKKU.d.ts +24 -0
- package/dist/types/segments/DKKKU.d.ts.map +1 -0
- package/dist/types/segments/HIBPA.d.ts +28 -0
- package/dist/types/segments/HIBPA.d.ts.map +1 -0
- package/dist/types/segments/HICAZ.d.ts +22 -0
- package/dist/types/segments/HICAZ.d.ts.map +1 -0
- package/dist/types/segments/HICAZS.d.ts +17 -0
- package/dist/types/segments/HICAZS.d.ts.map +1 -0
- package/dist/types/segments/HICCSS.d.ts +23 -0
- package/dist/types/segments/HICCSS.d.ts.map +1 -0
- package/dist/types/segments/HIEKA.d.ts +52 -0
- package/dist/types/segments/HIEKA.d.ts.map +1 -0
- package/dist/types/segments/HIEKAS.d.ts +21 -0
- package/dist/types/segments/HIEKAS.d.ts.map +1 -0
- package/dist/types/segments/HIKAZ.d.ts +17 -0
- package/dist/types/segments/HIKAZ.d.ts.map +1 -0
- package/dist/types/segments/HIKAZS.d.ts +16 -0
- package/dist/types/segments/HIKAZS.d.ts.map +1 -0
- package/dist/types/segments/HIKIM.d.ts +18 -0
- package/dist/types/segments/HIKIM.d.ts.map +1 -0
- package/dist/types/segments/HIKKU.d.ts +25 -0
- package/dist/types/segments/HIKKU.d.ts.map +1 -0
- package/dist/types/segments/HIKKUS.d.ts +21 -0
- package/dist/types/segments/HIKKUS.d.ts.map +1 -0
- package/dist/types/segments/HIKOM.d.ts +28 -0
- package/dist/types/segments/HIKOM.d.ts.map +1 -0
- package/dist/types/segments/HIPINS.d.ts +23 -0
- package/dist/types/segments/HIPINS.d.ts.map +1 -0
- package/dist/types/segments/HIRMG.d.ts +23 -0
- package/dist/types/segments/HIRMG.d.ts.map +1 -0
- package/dist/types/segments/HIRMS.d.ts +18 -0
- package/dist/types/segments/HIRMS.d.ts.map +1 -0
- package/dist/types/segments/HISAL.d.ts +33 -0
- package/dist/types/segments/HISAL.d.ts.map +1 -0
- package/dist/types/segments/HISPA.d.ts +17 -0
- package/dist/types/segments/HISPA.d.ts.map +1 -0
- package/dist/types/segments/HISPAS.d.ts +20 -0
- package/dist/types/segments/HISPAS.d.ts.map +1 -0
- package/dist/types/segments/HISYN.d.ts +20 -0
- package/dist/types/segments/HISYN.d.ts.map +1 -0
- package/dist/types/segments/HITAB.d.ts +40 -0
- package/dist/types/segments/HITAB.d.ts.map +1 -0
- package/dist/types/segments/HITAN.d.ts +26 -0
- package/dist/types/segments/HITAN.d.ts.map +1 -0
- package/dist/types/segments/HITANS.d.ts +46 -0
- package/dist/types/segments/HITANS.d.ts.map +1 -0
- package/dist/types/segments/HIUPA.d.ts +22 -0
- package/dist/types/segments/HIUPA.d.ts.map +1 -0
- package/dist/types/segments/HIUPD.d.ts +43 -0
- package/dist/types/segments/HIUPD.d.ts.map +1 -0
- package/dist/types/segments/HIVPAS.d.ts +21 -0
- package/dist/types/segments/HIVPAS.d.ts.map +1 -0
- package/dist/types/segments/HIVPP.d.ts +49 -0
- package/dist/types/segments/HIVPP.d.ts.map +1 -0
- package/dist/types/segments/HIVPPS.d.ts +27 -0
- package/dist/types/segments/HIVPPS.d.ts.map +1 -0
- package/dist/types/segments/HIWPD.d.ts +22 -0
- package/dist/types/segments/HIWPD.d.ts.map +1 -0
- package/dist/types/segments/HKCAZ.d.ts +27 -0
- package/dist/types/segments/HKCAZ.d.ts.map +1 -0
- package/dist/types/segments/HKCCS.d.ts +32 -0
- package/dist/types/segments/HKCCS.d.ts.map +1 -0
- package/dist/types/segments/HKEKA.d.ts +54 -0
- package/dist/types/segments/HKEKA.d.ts.map +1 -0
- package/dist/types/segments/HKEND.d.ts +17 -0
- package/dist/types/segments/HKEND.d.ts.map +1 -0
- package/dist/types/segments/HKIDN.d.ts +23 -0
- package/dist/types/segments/HKIDN.d.ts.map +1 -0
- package/dist/types/segments/HKKAZ.d.ts +26 -0
- package/dist/types/segments/HKKAZ.d.ts.map +1 -0
- package/dist/types/segments/HKKKU.d.ts +26 -0
- package/dist/types/segments/HKKKU.d.ts.map +1 -0
- package/dist/types/segments/HKSAL.d.ts +23 -0
- package/dist/types/segments/HKSAL.d.ts.map +1 -0
- package/dist/types/segments/HKSPA.d.ts +21 -0
- package/dist/types/segments/HKSPA.d.ts.map +1 -0
- package/dist/types/segments/HKSYN.d.ts +18 -0
- package/dist/types/segments/HKSYN.d.ts.map +1 -0
- package/dist/types/segments/HKTAB.d.ts +20 -0
- package/dist/types/segments/HKTAB.d.ts.map +1 -0
- package/dist/types/segments/HKTAN.d.ts +41 -0
- package/dist/types/segments/HKTAN.d.ts.map +1 -0
- package/dist/types/segments/HKVPA.d.ts +22 -0
- package/dist/types/segments/HKVPA.d.ts.map +1 -0
- package/dist/types/segments/HKVPP.d.ts +37 -0
- package/dist/types/segments/HKVPP.d.ts.map +1 -0
- package/dist/types/segments/HKVVB.d.ts +23 -0
- package/dist/types/segments/HKVVB.d.ts.map +1 -0
- package/dist/types/segments/HKWPD.d.ts +43 -0
- package/dist/types/segments/HKWPD.d.ts.map +1 -0
- package/dist/types/segments/HNHBK.d.ts +24 -0
- package/dist/types/segments/HNHBK.d.ts.map +1 -0
- package/dist/types/segments/HNHBS.d.ts +17 -0
- package/dist/types/segments/HNHBS.d.ts.map +1 -0
- package/dist/types/segments/HNSHA.d.ts +25 -0
- package/dist/types/segments/HNSHA.d.ts.map +1 -0
- package/dist/types/segments/HNSHK.d.ts +67 -0
- package/dist/types/segments/HNSHK.d.ts.map +1 -0
- package/dist/types/segments/HNVSD.d.ts +21 -0
- package/dist/types/segments/HNVSD.d.ts.map +1 -0
- package/dist/types/segments/HNVSK.d.ts +41 -0
- package/dist/types/segments/HNVSK.d.ts.map +1 -0
- package/dist/types/segments/businessTransactionParameter.d.ts +18 -0
- package/dist/types/segments/businessTransactionParameter.d.ts.map +1 -0
- package/dist/types/segments/registry.d.ts +4 -0
- package/dist/types/segments/registry.d.ts.map +1 -0
- package/dist/types/statement.d.ts +39 -0
- package/dist/types/statement.d.ts.map +1 -0
- package/dist/types/tanMethod.d.ts +31 -0
- package/dist/types/tanMethod.d.ts.map +1 -0
- package/dist/types/tests/HIBPA.test.d.ts +2 -0
- package/dist/types/tests/HIBPA.test.d.ts.map +1 -0
- package/dist/types/tests/HICAZS.test.d.ts +2 -0
- package/dist/types/tests/HICAZS.test.d.ts.map +1 -0
- package/dist/types/tests/HICCSS.test.d.ts +2 -0
- package/dist/types/tests/HICCSS.test.d.ts.map +1 -0
- package/dist/types/tests/HIPINS.test.d.ts +2 -0
- package/dist/types/tests/HIPINS.test.d.ts.map +1 -0
- package/dist/types/tests/HIRMG.test.d.ts +2 -0
- package/dist/types/tests/HIRMG.test.d.ts.map +1 -0
- package/dist/types/tests/HITAB.test.d.ts +2 -0
- package/dist/types/tests/HITAB.test.d.ts.map +1 -0
- package/dist/types/tests/HITANS.test.d.ts +2 -0
- package/dist/types/tests/HITANS.test.d.ts.map +1 -0
- package/dist/types/tests/HIUPA.test.d.ts +2 -0
- package/dist/types/tests/HIUPA.test.d.ts.map +1 -0
- package/dist/types/tests/HIUPD.test.d.ts +2 -0
- package/dist/types/tests/HIUPD.test.d.ts.map +1 -0
- package/dist/types/tests/HIVPAS.test.d.ts +2 -0
- package/dist/types/tests/HIVPAS.test.d.ts.map +1 -0
- package/dist/types/tests/HIVPP.test.d.ts +2 -0
- package/dist/types/tests/HIVPP.test.d.ts.map +1 -0
- package/dist/types/tests/HIVPPS.test.d.ts +2 -0
- package/dist/types/tests/HIVPPS.test.d.ts.map +1 -0
- package/dist/types/tests/HIWPD.test.d.ts +2 -0
- package/dist/types/tests/HIWPD.test.d.ts.map +1 -0
- package/dist/types/tests/HKCAZ.test.d.ts +2 -0
- package/dist/types/tests/HKCAZ.test.d.ts.map +1 -0
- package/dist/types/tests/HKCCS.test.d.ts +2 -0
- package/dist/types/tests/HKCCS.test.d.ts.map +1 -0
- package/dist/types/tests/HKEKA.test.d.ts +2 -0
- package/dist/types/tests/HKEKA.test.d.ts.map +1 -0
- package/dist/types/tests/HKIDN.test.d.ts +2 -0
- package/dist/types/tests/HKIDN.test.d.ts.map +1 -0
- package/dist/types/tests/HKKKU.test.d.ts +2 -0
- package/dist/types/tests/HKKKU.test.d.ts.map +1 -0
- package/dist/types/tests/HKSAL.test.d.ts +2 -0
- package/dist/types/tests/HKSAL.test.d.ts.map +1 -0
- package/dist/types/tests/HKTAN.test.d.ts +2 -0
- package/dist/types/tests/HKTAN.test.d.ts.map +1 -0
- package/dist/types/tests/HKVPA.test.d.ts +2 -0
- package/dist/types/tests/HKVPA.test.d.ts.map +1 -0
- package/dist/types/tests/HKVPP.test.d.ts +2 -0
- package/dist/types/tests/HKVPP.test.d.ts.map +1 -0
- package/dist/types/tests/HKWPD.test.d.ts +2 -0
- package/dist/types/tests/HKWPD.test.d.ts.map +1 -0
- package/dist/types/tests/HNSHK.test.d.ts +2 -0
- package/dist/types/tests/HNSHK.test.d.ts.map +1 -0
- package/dist/types/tests/HNVSK.test.d.ts +2 -0
- package/dist/types/tests/HNVSK.test.d.ts.map +1 -0
- package/dist/types/tests/accountDescriptor.test.d.ts +2 -0
- package/dist/types/tests/accountDescriptor.test.d.ts.map +1 -0
- package/dist/types/tests/accountReference.test.d.ts +2 -0
- package/dist/types/tests/accountReference.test.d.ts.map +1 -0
- package/dist/types/tests/bankReplyChecks.test.d.ts +2 -0
- package/dist/types/tests/bankReplyChecks.test.d.ts.map +1 -0
- package/dist/types/tests/camtParser.test.d.ts +2 -0
- package/dist/types/tests/camtParser.test.d.ts.map +1 -0
- package/dist/types/tests/client.test.d.ts +2 -0
- package/dist/types/tests/client.test.d.ts.map +1 -0
- package/dist/types/tests/credentialRedaction.test.d.ts +2 -0
- package/dist/types/tests/credentialRedaction.test.d.ts.map +1 -0
- package/dist/types/tests/creditTransfer.test.d.ts +2 -0
- package/dist/types/tests/creditTransfer.test.d.ts.map +1 -0
- package/dist/types/tests/creditTransferBank.d.ts +63 -0
- package/dist/types/tests/creditTransferBank.d.ts.map +1 -0
- package/dist/types/tests/creditTransferSafety.test.d.ts +2 -0
- package/dist/types/tests/creditTransferSafety.test.d.ts.map +1 -0
- package/dist/types/tests/datatypes.test.d.ts +2 -0
- package/dist/types/tests/datatypes.test.d.ts.map +1 -0
- package/dist/types/tests/dialog.test.d.ts +2 -0
- package/dist/types/tests/dialog.test.d.ts.map +1 -0
- package/dist/types/tests/httpClientErrorLog.test.d.ts +2 -0
- package/dist/types/tests/httpClientErrorLog.test.d.ts.map +1 -0
- package/dist/types/tests/interactionAccountDescriptor.test.d.ts +2 -0
- package/dist/types/tests/interactionAccountDescriptor.test.d.ts.map +1 -0
- package/dist/types/tests/message.test.d.ts +2 -0
- package/dist/types/tests/message.test.d.ts.map +1 -0
- package/dist/types/tests/mt535parser.test.d.ts +2 -0
- package/dist/types/tests/mt535parser.test.d.ts.map +1 -0
- package/dist/types/tests/mt940parser.test.d.ts +2 -0
- package/dist/types/tests/mt940parser.test.d.ts.map +1 -0
- package/dist/types/tests/pain001Builder.test.d.ts +2 -0
- package/dist/types/tests/pain001Builder.test.d.ts.map +1 -0
- package/dist/types/tests/pain002Parser.test.d.ts +2 -0
- package/dist/types/tests/pain002Parser.test.d.ts.map +1 -0
- package/dist/types/tests/parser.test.d.ts +2 -0
- package/dist/types/tests/parser.test.d.ts.map +1 -0
- package/dist/types/tests/partedDialog.test.d.ts +2 -0
- package/dist/types/tests/partedDialog.test.d.ts.map +1 -0
- package/dist/types/tests/partedResponse.test.d.ts +2 -0
- package/dist/types/tests/partedResponse.test.d.ts.map +1 -0
- package/dist/types/tests/statementParseFailure.test.d.ts +2 -0
- package/dist/types/tests/statementParseFailure.test.d.ts.map +1 -0
- package/dist/types/tests/tanMedia.test.d.ts +2 -0
- package/dist/types/tests/tanMedia.test.d.ts.map +1 -0
- package/dist/types/unknownSegment.d.ts +15 -0
- package/dist/types/unknownSegment.d.ts.map +1 -0
- package/dist/types/upd.d.ts +8 -0
- package/dist/types/upd.d.ts.map +1 -0
- package/dist/unknownSegment.js +11 -0
- package/dist/upd.js +1 -0
- package/package.json +59 -5
- package/pnpm-workspace.yaml +8 -0
- package/src/accountBalance.ts +8 -0
- package/src/accountDescriptor.ts +78 -0
- package/src/bankAccount.ts +59 -0
- package/src/bankAnswer.ts +5 -0
- package/src/bankTransaction.ts +25 -0
- package/src/bankingInformation.ts +21 -0
- package/src/bpd.ts +17 -0
- package/src/camtParser.ts +698 -0
- package/src/client.ts +1005 -0
- package/src/codes.ts +86 -0
- package/src/config.ts +338 -0
- package/src/creditCardStatement.ts +26 -0
- package/src/dataElements/AlphaNumeric.ts +35 -0
- package/src/dataElements/Amount.ts +7 -0
- package/src/dataElements/Binary.ts +50 -0
- package/src/dataElements/Country.ts +7 -0
- package/src/dataElements/Currency.ts +7 -0
- package/src/dataElements/Dat.ts +22 -0
- package/src/dataElements/DataElement.ts +41 -0
- package/src/dataElements/Digits.ts +34 -0
- package/src/dataElements/Float.ts +31 -0
- package/src/dataElements/Identification.ts +7 -0
- package/src/dataElements/Numeric.ts +38 -0
- package/src/dataElements/Text.ts +31 -0
- package/src/dataElements/Time.ts +24 -0
- package/src/dataElements/YesNo.ts +23 -0
- package/src/dataGroups/Account.ts +31 -0
- package/src/dataGroups/Balance.ts +30 -0
- package/src/dataGroups/BankIdentification.ts +16 -0
- package/src/dataGroups/DataGroup.ts +76 -0
- package/src/dataGroups/InternationalAccount.ts +32 -0
- package/src/dataGroups/Money.ts +21 -0
- package/src/dataGroups/RefMessage.ts +21 -0
- package/src/dataGroups/SepaAccount.ts +32 -0
- package/src/dataGroups/TimeStamp.ts +21 -0
- package/src/decoder.ts +125 -0
- package/src/dialog.ts +625 -0
- package/src/electronicStatement.ts +51 -0
- package/src/encoder.ts +87 -0
- package/src/format.ts +7 -0
- package/src/httpClient.ts +90 -0
- package/src/index.ts +53 -0
- package/src/interactions/balanceInteraction.ts +65 -0
- package/src/interactions/creditTransferInteraction.ts +667 -0
- package/src/interactions/creditcardStatementInteraction.ts +134 -0
- package/src/interactions/creditcardStatementInteractionHKKKU.ts +163 -0
- package/src/interactions/customerInteraction.ts +191 -0
- package/src/interactions/electronicStatementInteraction.ts +132 -0
- package/src/interactions/endDialogInteraction.ts +28 -0
- package/src/interactions/initDialogInteraction.ts +300 -0
- package/src/interactions/portfolioInteraction.ts +97 -0
- package/src/interactions/sepaAccountInteraction.ts +68 -0
- package/src/interactions/statementInteractionCAMT.ts +87 -0
- package/src/interactions/statementInteractionMT940.ts +60 -0
- package/src/interactions/tanMediaInteraction.ts +54 -0
- package/src/interactions/transferOutcome.ts +513 -0
- package/src/interactions/vopCheck.ts +502 -0
- package/src/message.ts +305 -0
- package/src/mt535parser.ts +199 -0
- package/src/mt940parser.ts +395 -0
- package/src/pain001Builder.ts +446 -0
- package/src/pain002Parser.ts +233 -0
- package/src/parser.ts +31 -0
- package/src/partedSegment.ts +19 -0
- package/src/segment.ts +114 -0
- package/src/segmentDefinition.ts +36 -0
- package/src/segmentHeader.ts +26 -0
- package/src/segments/DIKKU.ts +30 -0
- package/src/segments/DKKKU.ts +35 -0
- package/src/segments/HIBPA.ts +42 -0
- package/src/segments/HICAZ.ts +34 -0
- package/src/segments/HICAZS.ts +33 -0
- package/src/segments/HICCSS.ts +31 -0
- package/src/segments/HIEKA.ts +68 -0
- package/src/segments/HIEKAS.ts +36 -0
- package/src/segments/HIKAZ.ts +23 -0
- package/src/segments/HIKAZS.ts +34 -0
- package/src/segments/HIKIM.ts +21 -0
- package/src/segments/HIKKU.ts +35 -0
- package/src/segments/HIKKUS.ts +36 -0
- package/src/segments/HIKOM.ts +49 -0
- package/src/segments/HIPINS.ts +48 -0
- package/src/segments/HIRMG.ts +41 -0
- package/src/segments/HIRMS.ts +35 -0
- package/src/segments/HISAL.ts +51 -0
- package/src/segments/HISPA.ts +20 -0
- package/src/segments/HISPAS.ts +42 -0
- package/src/segments/HISYN.ts +28 -0
- package/src/segments/HITAB.ts +76 -0
- package/src/segments/HITAN.ts +39 -0
- package/src/segments/HITANS.ts +102 -0
- package/src/segments/HIUPA.ts +32 -0
- package/src/segments/HIUPD.ts +82 -0
- package/src/segments/HIVPAS.ts +29 -0
- package/src/segments/HIVPP.ts +75 -0
- package/src/segments/HIVPPS.ts +47 -0
- package/src/segments/HIWPD.ts +25 -0
- package/src/segments/HKCAZ.ts +42 -0
- package/src/segments/HKCCS.ts +43 -0
- package/src/segments/HKEKA.ts +69 -0
- package/src/segments/HKEND.ts +20 -0
- package/src/segments/HKIDN.ts +31 -0
- package/src/segments/HKKAZ.ts +40 -0
- package/src/segments/HKKKU.ts +41 -0
- package/src/segments/HKSAL.ts +35 -0
- package/src/segments/HKSPA.ts +28 -0
- package/src/segments/HKSYN.ts +21 -0
- package/src/segments/HKTAB.ts +23 -0
- package/src/segments/HKTAN.ts +72 -0
- package/src/segments/HKVPA.ts +26 -0
- package/src/segments/HKVPP.ts +46 -0
- package/src/segments/HKVVB.ts +32 -0
- package/src/segments/HKWPD.ts +52 -0
- package/src/segments/HNHBK.ts +33 -0
- package/src/segments/HNHBS.ts +20 -0
- package/src/segments/HNSHA.ts +38 -0
- package/src/segments/HNSHK.ts +145 -0
- package/src/segments/HNVSD.ts +22 -0
- package/src/segments/HNVSK.ts +110 -0
- package/src/segments/businessTransactionParameter.ts +33 -0
- package/src/segments/registry.ts +125 -0
- package/src/statement.ts +40 -0
- package/src/tanMethod.ts +32 -0
- package/src/tests/HIBPA.test.ts +33 -0
- package/src/tests/HICAZS.test.ts +24 -0
- package/src/tests/HICCSS.test.ts +20 -0
- package/src/tests/HIPINS.test.ts +19 -0
- package/src/tests/HIRMG.test.ts +33 -0
- package/src/tests/HITAB.test.ts +33 -0
- package/src/tests/HITANS.test.ts +27 -0
- package/src/tests/HIUPA.test.ts +13 -0
- package/src/tests/HIUPD.test.ts +13 -0
- package/src/tests/HIVPAS.test.ts +20 -0
- package/src/tests/HIVPP.test.ts +75 -0
- package/src/tests/HIVPPS.test.ts +37 -0
- package/src/tests/HIWPD.test.ts +32 -0
- package/src/tests/HKCAZ.test.ts +56 -0
- package/src/tests/HKCCS.test.ts +64 -0
- package/src/tests/HKEKA.test.ts +252 -0
- package/src/tests/HKIDN.test.ts +26 -0
- package/src/tests/HKKKU.test.ts +248 -0
- package/src/tests/HKSAL.test.ts +52 -0
- package/src/tests/HKTAN.test.ts +26 -0
- package/src/tests/HKVPA.test.ts +25 -0
- package/src/tests/HKVPP.test.ts +54 -0
- package/src/tests/HKWPD.test.ts +47 -0
- package/src/tests/HNSHK.test.ts +14 -0
- package/src/tests/HNVSK.test.ts +14 -0
- package/src/tests/accountDescriptor.test.ts +113 -0
- package/src/tests/accountReference.test.ts +150 -0
- package/src/tests/bankReplyChecks.test.ts +75 -0
- package/src/tests/camtParser.test.ts +1068 -0
- package/src/tests/client.test.ts +826 -0
- package/src/tests/credentialRedaction.test.ts +75 -0
- package/src/tests/creditTransfer.test.ts +2433 -0
- package/src/tests/creditTransferBank.ts +245 -0
- package/src/tests/creditTransferSafety.test.ts +573 -0
- package/src/tests/datatypes.test.ts +9 -0
- package/src/tests/dialog.test.ts +579 -0
- package/src/tests/httpClientErrorLog.test.ts +41 -0
- package/src/tests/interactionAccountDescriptor.test.ts +203 -0
- package/src/tests/message.test.ts +130 -0
- package/src/tests/mt535parser.test.ts +280 -0
- package/src/tests/mt940parser.test.ts +91 -0
- package/src/tests/pain001Builder.test.ts +474 -0
- package/src/tests/pain002Parser.test.ts +191 -0
- package/src/tests/parser.test.ts +34 -0
- package/src/tests/partedDialog.test.ts +309 -0
- package/src/tests/partedResponse.test.ts +234 -0
- package/src/tests/statementParseFailure.test.ts +23 -0
- package/src/tests/tanMedia.test.ts +163 -0
- package/src/unknownSegment.ts +19 -0
- package/src/upd.ts +8 -0
- package/tsconfig.json +103 -0
package/README.md
CHANGED
|
@@ -1,3 +1,424 @@
|
|
|
1
|
-
|
|
1
|
+
> **This is a modified version of [lib-fints](https://github.com/robocode13/lib-fints) 1.5.4 by Robert Weber**, published as `@davidvornholt/lib-fints` from [davidvornholt/lib-fints](https://github.com/davidvornholt/lib-fints/tree/dv). It adds what upstream hasn't released yet; [FORK.md](https://github.com/davidvornholt/lib-fints/blob/dv/FORK.md) lists the changes, and each source file the fork added or changed says so in its first line. It is licensed under the LGPL-2.1-or-later like the original, and its source is in `src`.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/robocode13/lib-fints/actions/workflows/ci.yml)
|
|
4
|
+
|
|
5
|
+
# Lib-FinTS
|
|
6
|
+
|
|
7
|
+
A Typescript/Javascript client library for Online-Banking via the FinTS 3.0 protocol with PIN/TAN, supporting PSD2 and decoupled TAN methods.
|
|
8
|
+
|
|
9
|
+
## Getting Started
|
|
10
|
+
|
|
11
|
+
These instructions will show you how to install the library on your local machine and give a quick sample of how to use the library
|
|
12
|
+
|
|
13
|
+
### Prerequisites
|
|
14
|
+
|
|
15
|
+
#### Product Registration
|
|
16
|
+
|
|
17
|
+
In order to communicate with banks via the FinTS protocol you have to register a product ID with the german banking industry (Deutsche Kreditwirtschaft) which you need to pass as part of the configuration to the client:
|
|
18
|
+
|
|
19
|
+
> In order to fulfill the PSD2 requirements regarding transparency about the software used by customers, the German Banking Industry has established a process for registering FinTS products in order to be able to provide customers with information regarding FinTS usage.
|
|
20
|
+
> FinTS product registration is currently offered free of charge by the German Banking Industry.
|
|
21
|
+
|
|
22
|
+
[ZKA Registration Website](https://www.fints.org/de/hersteller/produktregistrierung)
|
|
23
|
+
|
|
24
|
+
### Runtime Environment
|
|
25
|
+
|
|
26
|
+
The library is written in Typescript and compiled to the ES2022 Javascript language standard which means a minimum Node version of 18 is required.
|
|
27
|
+
|
|
28
|
+
**A note about Browsers:**
|
|
29
|
+
In theory the library is compatible with a browser environment, but communicating directly from the front-end with a bank server will, apart from security considerations, most likely fail because of the imposed CORS restrictions from web browsers and the lack of corresponding CORS headers in bank server responses.
|
|
30
|
+
|
|
31
|
+
### Installing
|
|
32
|
+
|
|
33
|
+
Installation is straight forward by simply adding the npm package.
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
npm i lib-fints
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Dependencies**: The library includes the `fast-xml-parser` package for robust CAMT statement parsing but has no other runtime dependencies.
|
|
40
|
+
|
|
41
|
+
### Sample Usage
|
|
42
|
+
|
|
43
|
+
The main public API of this library is the `FinTSClient` class and `FinTSConfig` class. In order to instantiate the client you need to provide a configuration instance. There are basically two ways to initialize a configuration object, one is when you communicate with a bank for the first time and the other when you already have banking information from a prevous session available (more on that later).
|
|
44
|
+
|
|
45
|
+
If you don't have any previous banking information available you can use the static `forFirstTimeUse()` factory method like this:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
const config = FinTSConfig.forFirstTimeUse(productId, productVersion, bankUrl, bankId, userId, pin);
|
|
49
|
+
|
|
50
|
+
const client = new FinTSClient(config);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Then you should first make a synchronization call to get banking and account information:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
let syncResponse = await client.synchronize();
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
you should always check the `success` and `requiresTan` properties of any response object because other data might only be available when `success=true` and `requiresTan=false`.
|
|
60
|
+
in any case you can also check the `bankAnswers` array for return messages from the bank which may contain the reasons for a failed request.
|
|
61
|
+
|
|
62
|
+
If the call is successfull the response will contain a `bankingInformation` object filled with all the relevant information provided by the bank from synchronization:
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
export type BankingInformation = {
|
|
66
|
+
systemId: string;
|
|
67
|
+
bpd?: BPD;
|
|
68
|
+
upd?: UPD;
|
|
69
|
+
bankMessages: BankMessage[];
|
|
70
|
+
};
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The BPD object (_BankParameterDaten_) contains general information (e.g. available TAN methods and allowed transactions) and the UPD object (_UserParameterDaten_) user-specific information which is mainly the list of the user's bank accounts.
|
|
74
|
+
|
|
75
|
+
Unfortunately with this first synchronization call most banks will likely only return the BPA information but no UPD (accounts) information, which is needed to fetch balances or statements. The reason for this is that you need to specify a TAN method before making the synchronization call, but you can only know which TAN methods are available from the BPA? This is why you need to make a second synchronization call with a TAN method selected from the `availableTanMethodIds`in the BPA, returned from the first synchronization call:
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
// for simplicity, we just select the first available TAN method
|
|
79
|
+
client.selectTanMethod(syncResponse.bankingInformation.BPD.availableTanMethodIds[0]);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
now you can repeat the syncronization call from above and it will return additional data including the UPD with the account information.
|
|
83
|
+
|
|
84
|
+
Finally you can start fetching balances or statements:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// for simplicity, use the first account
|
|
88
|
+
const account = syncResponse.bankingInformation.upd.bankAccounts[0];
|
|
89
|
+
|
|
90
|
+
// Account-specific methods accept either an account number or a BankAccount.
|
|
91
|
+
// Pass the account object when multiple accounts share the same number.
|
|
92
|
+
|
|
93
|
+
// fetch the current balance
|
|
94
|
+
const balanceResponse = await client.getAccountBalance(account);
|
|
95
|
+
|
|
96
|
+
// fetch all available statements
|
|
97
|
+
const statementResponse = await client.getAccountStatements(account);
|
|
98
|
+
|
|
99
|
+
// or fetch portfolio from a securities account
|
|
100
|
+
client.getPortfolio(account);
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
These are only the most basic steps needed to retrieve information from the bank. There are still some unanswered questions like "how to handle TANs" or "how to avoid synchronizations every time you start a new session". These are explained in the corresponding sections below.
|
|
104
|
+
|
|
105
|
+
## More detailed API Description
|
|
106
|
+
|
|
107
|
+
### Handle TAN challenges from the bank
|
|
108
|
+
|
|
109
|
+
Most transactions may require authorization with a two step TAN process. As mentioned above in the sample, every response may set the `requiresTan`property to `true` which means that the response does not include the expected transaction data, but some additional TAN related properties. You first need to handle this TAN challenge by asking the user for the TAN and sending it back to the bank to continue the process and retrieve the actual transaction result:
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
// we use the node readline interface later to ask the user for a TAN
|
|
113
|
+
const rl = readline.createInterface({
|
|
114
|
+
input: process.stdin,
|
|
115
|
+
output: process.stdout,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
let response = await client.getAccountStatements(account);
|
|
119
|
+
|
|
120
|
+
if (!response.success) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// need to check if a TAN is required to continue the transaction
|
|
125
|
+
if (response.requiresTan) {
|
|
126
|
+
// asking the user for the TAN, using the tanChallenge property
|
|
127
|
+
const tan = await rl.question(response.tanChallenge + ': ');
|
|
128
|
+
// continue the transaction by providing the tanReference from the response and the entered TAN
|
|
129
|
+
response = await client.getAccountStatementsWithTan(response.tanReference!, tan);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
The `FinTSClient`contains for every transaction method like `synchronize()` or `getAccountStatements()` a corresponding `...WithTan()` method which needs to be called to continue the transaction with the given `tanReference` returned in the first response. The response object of this second call should now contain all transaction related data, assuming `success=true`.
|
|
134
|
+
|
|
135
|
+
**Decoupled TAN methods**
|
|
136
|
+
|
|
137
|
+
The library now also supports decoupled TAN methods where you don't actually have to provide a TAN entered by a user, but the approval is done "decoupled" on another device (e.g. mobile phone via banking app). The procedure explained above is still very similar, `requiresTan` will signal a required approval and you can continue with one of the `...WithTan()` methods where you can ommit the last `tan` parameter.
|
|
138
|
+
|
|
139
|
+
You could ask the user to confirm that the approval was given and then continue with the call or periodically call the method until it returns the transaction result (`requiresTan=false` and `success=true`). The continuation methods will keep returning `requiresTan=true` as long as the user hasn't approved the transaction.
|
|
140
|
+
|
|
141
|
+
see also the `decoupled` property on the `TanMethod` object for related parameters given by the bank.
|
|
142
|
+
|
|
143
|
+
**chipTAN optisch / flicker codes**
|
|
144
|
+
|
|
145
|
+
For chipTAN methods the bank sends the challenge data for the TAN generator in the HITAN segment. The response exposes it unchanged as `tanChallengeHhdUc` (a string with the HHD 1.3/1.4 start code and data elements), so that a client can render the optical flicker animation; `tanPhoto` only applies to photoTAN banks that put an image container into the same field.
|
|
146
|
+
|
|
147
|
+
### SEPA credit transfers
|
|
148
|
+
|
|
149
|
+
Until transfers were added, this library only read data from the bank. Three methods change that: `transfer()` starts a payment, and its first call can already be final, because a bank may execute the transfer without asking for a confirmation or a TAN; `confirmTransfer()` and `transferWithTan()` can authorise a payment that is pending. All other methods only read, so an application that never calls these three never sends an order that moves money.
|
|
150
|
+
|
|
151
|
+
A transfer is a single SEPA credit transfer (HKCCS), executed as soon as possible. Where the bank requires Verification of Payee (VoP) for transfers, as all banks in the euro area must since October 2025, the bank first checks the payee's name against the IBAN, and the application gets the result before the transfer can be executed. The bank may ask for a decision or a TAN in any order, and more than once (a TAN for the login first, a decision after a TAN), so the application asks again after every call for as long as either flag is set:
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
if (!client.canTransfer(account)) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
let response = await client.transfer(account, {
|
|
159
|
+
name: 'Max Mustermann',
|
|
160
|
+
iban: 'DE02120300000000202051',
|
|
161
|
+
amount: 42.5,
|
|
162
|
+
purpose: 'Invoice 2026-001',
|
|
163
|
+
endToEndId: 'INVOICE-2026-001',
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
while (response.success && (response.requiresVopConfirmation || response.requiresTan)) {
|
|
167
|
+
if (response.requiresVopConfirmation) {
|
|
168
|
+
const vop = response.vop!;
|
|
169
|
+
console.log(`Verification of Payee: ${vop.result}`);
|
|
170
|
+
if (vop.suggestedName) {
|
|
171
|
+
console.log(`The payee's bank holds the name ${vop.suggestedName}`);
|
|
172
|
+
}
|
|
173
|
+
// the bank's notices must be shown before the user decides: those of the
|
|
174
|
+
// payment status report start with the result code they are about
|
|
175
|
+
for (const line of vop.paymentStatusReport?.groupReasons ?? []) {
|
|
176
|
+
console.log(line.replace(/^[A-Z]{4} /, ''));
|
|
177
|
+
}
|
|
178
|
+
if (vop.notice) {
|
|
179
|
+
console.log(vop.notice);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if ((await rl.question('Send the transfer anyway? (yes/no) ')) !== 'yes') {
|
|
183
|
+
await client.cancelTransfer(response.transferId);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
response = await client.confirmTransfer(response.transferId);
|
|
187
|
+
} else {
|
|
188
|
+
// with a decoupled TAN method, the user approves in the app and just presses enter
|
|
189
|
+
const tan = await rl.question(response.tanChallenge + ': ');
|
|
190
|
+
response = await client.transferWithTan(response.tanReference!, tan || undefined);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (response.success) {
|
|
195
|
+
console.log(`The bank accepted the transfer ${response.endToEndId}`);
|
|
196
|
+
} else if (response.outcomeUncertain) {
|
|
197
|
+
console.log('The bank may have executed the transfer; check the account before sending it again');
|
|
198
|
+
} else {
|
|
199
|
+
console.log(response.failureReason, response.bankAnswers);
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Each call returns a `TransferResponse`:
|
|
204
|
+
|
|
205
|
+
| Response | Meaning | Next call |
|
|
206
|
+
| ------------------------------------------ | ----------------------------------------------------------------------- | --------------------------------------- |
|
|
207
|
+
| `success` and `requiresVopConfirmation` | The bank has checked the payee and waits for a decision; see `vop` | `confirmTransfer(transferId)` or `cancelTransfer(transferId)` |
|
|
208
|
+
| `success` and `requiresTan` | The bank asks for the TAN | `transferWithTan()` or `cancelTransfer(transferId)` |
|
|
209
|
+
| `success`, neither flag | The bank reports the transfer as executed (0020, or 3091 with 3076) | - |
|
|
210
|
+
| `success: false` | The transfer stopped; `failureReason` and `bankAnswers` say why | - |
|
|
211
|
+
| `success: false` and `outcomeUncertain` | The bank may have executed the transfer without confirming it: it received the order (0010, 0030, 3070), holds it for an approval or waived the checks (3091 with 3076), and a later step failed, got no answer or timed out; or it answered 9000, reported a duplicate (9390) or an authorisation of an order that may have been executed already (9210); or it reported an execution its other answers contradict | Check the account before sending it again |
|
|
212
|
+
|
|
213
|
+
The transfer is done only when `success` is true and neither `requiresTan` nor `requiresVopConfirmation` is.
|
|
214
|
+
|
|
215
|
+
The result in `vop`:
|
|
216
|
+
|
|
217
|
+
| `vop.result` | Code | Meaning |
|
|
218
|
+
| --------------- | ---- | ---------------------------------------------------------------------------------------- |
|
|
219
|
+
| `match` | RCVC | The name matches the account |
|
|
220
|
+
| `closeMatch` | RVMC | The name almost matches; `suggestedName` is the name the payee's bank holds |
|
|
221
|
+
| `noMatch` | RVNM | The name does not match |
|
|
222
|
+
| `notApplicable` | RVNA | The check was not possible, for example because the payee's bank does not take part |
|
|
223
|
+
|
|
224
|
+
`vop.notice` is the bank's explanation of what authorising a transfer despite a deviation means; the DK specification requires showing it before the user decides. Authorising anyway may send the money to someone else, and the payer's bank is then not liable for that. A bank that sends a payment status report (pain.002) may put its notices into the report instead, as the lines of `vop.paymentStatusReport.groupReasons`, each starting with the result code it is about; show them as well.
|
|
225
|
+
|
|
226
|
+
Things to know before using it:
|
|
227
|
+
|
|
228
|
+
- **Nothing is confirmed automatically.** The library never calls `confirmTransfer()` itself. For a match, banks usually ask for the TAN straight away; a bank that still asks for a confirmation of a match may be confirmed by the application without asking the user again. Every other result needs the user's decision.
|
|
229
|
+
- **The first call can be final.** A bank may execute the transfer without a confirmation and without a TAN, for example after a match when it requires no strong authentication (codes 3091 and 3076). Call `transfer()` only once the user has decided to send the money.
|
|
230
|
+
- **Input is checked, never changed.** `transfer()` throws a `SepaValidationError` naming the `field` before anything is sent (its message never repeats the value, so that it can be logged): the IBAN (its characters, the length for its country and the check digits), the BIC, the amount (positive, at most two decimal places, at most 999,999,999.99 EUR), the lengths and the allowed characters. Nothing is transliterated or shortened.
|
|
231
|
+
- **Unexpected answers stop the transfer.** An unknown result code, a missing VoP ID, a payment status report that is about another order or contradicts itself, a TAN challenge without its reference, or another answer the library does not expect ends the transfer with `success: false` and the bank answers, instead of guessing.
|
|
232
|
+
- **The order goes to the bank once.** The only time it is sent again is with the confirmation of a payee check result (HKVPA with the order, as the DK specification has it), once, and only while the bank holds nothing of the first one that it could execute. Whatever else would send it again ends the transfer with `outcomeUncertain` instead.
|
|
233
|
+
- **A decision holds for its result only.** When the bank sends a different payee check result after the user decided on one, with a TAN or a confirmation, the transfer ends instead of asking again: unexecuted where the bank holds nothing it could execute, otherwise with `outcomeUncertain`. Changing the `vop` of a response changes nothing.
|
|
234
|
+
- **A TAN goes out with the TAN method of its challenge.** `confirmTransfer()` and `transferWithTan()` throw without sending anything when no TAN method of version 6 or later is selected, or, for a TAN, when it is not the method the challenge was issued for; the transfer stays pending, so select the method again and repeat the call.
|
|
235
|
+
- **An exception after the first message leaves the outcome unknown.** If, for example, the connection fails while the order is at the bank, the bank may have executed it. Once the bank has received the order, a lost answer resolves with `outcomeUncertain` and the answers so far instead. Check the account before sending it again: sending it again is a new payment, even with the same `endToEndId`, and nothing stops the bank from executing both.
|
|
236
|
+
- **The `endToEndId` identifies a transfer only when you give it one.** Without it, every transfer carries the shared `NOTPROVIDED`. Even a reference of your own may not show on the payer's statement, so finding a transfer there may need the account, the amount, the payee and the date.
|
|
237
|
+
- **One transfer at a time.** A client handles one transfer at a time, in its own dialog, which stays open while the client waits for the decision or the TAN. Banks end idle dialogs after some minutes. Every response carries the `transferId` of its transfer; `confirmTransfer()` and `cancelTransfer()` take it, and `transferWithTan()` takes only the `tanReference` of the challenge outstanding, so that a late decision cannot act on another transfer. A call made while the previous one still waits for the bank throws without sending anything.
|
|
238
|
+
- **Synchronize once after upgrading.** A `bankingInformation` saved by an earlier release of this library lacks the bank's Verification of Payee parameters (HIVPPS), and `canTransfer()` stays false without them. `synchronize()` then asks the bank for its whole BPD again, keeping the system ID; persist the updated `bankingInformation` afterwards.
|
|
239
|
+
- **Asynchronous checks are polled for up to 60 seconds.** Some banks deliver the VoP result only after a while; `transfer()` waits as long as the bank says before asking again, and stops the transfer when it would have to wait more than 60 seconds in total: unexecuted if the bank has not yet received the order, otherwise with `outcomeUncertain`, since the bank may still execute it.
|
|
240
|
+
|
|
241
|
+
The transfer flow has been tested against mocked bank answers only. The behaviour of individual banks it handles comes from the DK specification and from what other FinTS libraries report; reports from real banks are welcome.
|
|
242
|
+
|
|
243
|
+
The pain.001 builder (`buildPain001()`) and the pain.002 parser (`parsePain002()`) are exported for applications that need them on their own.
|
|
244
|
+
|
|
245
|
+
### Starting a session from saved banking information
|
|
246
|
+
|
|
247
|
+
As mentioned earlier there is a second way to initialize the `FinTSClient` with a `FinTSConfig` when you already performed a synchronization in a previous session and this is by providing the `bankingInformation` object received from previous uses. This `bankingInformation` object, which contains the general bank (BPD) and accounts information (UPD), should be persisted after a session and reloaded in the next session.
|
|
248
|
+
This not only saves you from making the same synchronization requests every time before making a transaction, but the sychronization will also assign a `systemId` (a property in `bankingInformation`) to your client which should stay the same once assigned.
|
|
249
|
+
|
|
250
|
+
```typescript
|
|
251
|
+
const config = FinTSConfig.fromBankingInformation(
|
|
252
|
+
productId,
|
|
253
|
+
productVersion,
|
|
254
|
+
bankingInformation,
|
|
255
|
+
userId,
|
|
256
|
+
pin,
|
|
257
|
+
tanMethodId,
|
|
258
|
+
tanMediaName // when also needed (see below)
|
|
259
|
+
);
|
|
260
|
+
const client = new FinTSClient(config);
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
You should also set the TAN method to use, by using the optional `tanMethodId` and `tanMediaName` parameters or calling `client.selectTanMethod()` before making the first transaction.
|
|
264
|
+
|
|
265
|
+
#### Tan Media
|
|
266
|
+
|
|
267
|
+
It might be the case that you have more than one active TAN media available (like multiple mobile phones) and the bank requires you to also specify which TAN media to use.
|
|
268
|
+
You can find out if this is the case by inspecting the `TanMethod` object in the BPD.
|
|
269
|
+
You can get a list of all available TAN methods from the `config.availableTanMethods` property or if you already selected a TAN method with `config.selectedTanMethod`.
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
export type TanMethod = {
|
|
273
|
+
id: number;
|
|
274
|
+
name: string;
|
|
275
|
+
version: number;
|
|
276
|
+
activeTanMediaCount: number;
|
|
277
|
+
activeTanMedia: string[];
|
|
278
|
+
tanMediaRequirement: TanMediaRequirement;
|
|
279
|
+
};
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
The `TanMethod` object contains a property `tanMediaRequirement` and if this is set to `TanMediaRequirement.Required`, you also need to select a TAN media, either by providing the name in the configuration factory method `FinTSConfig.fromBankingInformation()` or by using `client.selectTanMedia()`.
|
|
283
|
+
|
|
284
|
+
The property `activeTanMedia` contains a list of the TAN media names you can use for selection.
|
|
285
|
+
|
|
286
|
+
That list comes with a synchronization. To fetch it on its own, also before any TAN media is selected, call `client.getTanMedia()`, which returns the names of the active TAN media in `tanMediaList`.
|
|
287
|
+
|
|
288
|
+
#### Banking Information may be updated any time
|
|
289
|
+
|
|
290
|
+
The `bankingInformation` is primarily obtained through the `synchronize()` calls as demonstrated above. However, it is possible that the banking information may have changed since the last synchronization call. To address this, the BPD and UPD are versioned, and with every transaction made, not just synchronizations, the currently used versions are provided to the bank. If any changes have occurred, the bank will send back new versions of the BPD and UPD respectively. This process is managed by the client, but it is essential to check the `bankingInformationUpdated` property, which is available in every response. This property indicates if there have been any changes, and it is important to persist the new version for future sessions. The most up-to-date version of the `bankingInformation` object can always be retrieved using `config.bankingInformation`.
|
|
291
|
+
|
|
292
|
+
### Debugging
|
|
293
|
+
|
|
294
|
+
If you need to debug issues and the `response.bankAnswers` don't provide enough information, you can enable debugging of messages with:
|
|
295
|
+
|
|
296
|
+
```typescript
|
|
297
|
+
config.debugEnabled = true;
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
This will print out all sent messages and received responses to the console in a structured format.
|
|
301
|
+
|
|
302
|
+
## Supported Transactions
|
|
303
|
+
|
|
304
|
+
The following table shows all transactions supported by the FinTSClient interface:
|
|
305
|
+
|
|
306
|
+
| Transaction | Method | Description | FinTS Segment(s) | TAN Support | Account-Specific |
|
|
307
|
+
| -------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -------------------------- | ----------- | ---------------- |
|
|
308
|
+
| **Synchronization** | `synchronize()` | Synchronizes bank and account information, updating config.bankingInformation | HKIDN, HKVVB, HKSYN, HKTAB | ✓ | ❌ |
|
|
309
|
+
| **Account Balance** | `getAccountBalance(account: AccountRef)` | Fetches the current balance for a specific account | HKSAL | ✓ | ✓ |
|
|
310
|
+
| **Account Statements** | `getAccountStatements(account: AccountRef, from?, to?)` | Fetches account transactions/statements for a date range (MT940 or CAMT format) | HKKAZ, HKCAZ | ✓ | ✓ |
|
|
311
|
+
| **Portfolio** | `getPortfolio(account: AccountRef, currency?, priceQuality?, maxEntries?)` | Fetches securities portfolio information for depot accounts | HKWPD | ✓ | ✓ |
|
|
312
|
+
| **Credit Card Statements** | `getCreditCardStatements(account: AccountRef, from?, to?)` | Fetches credit card statements for credit card accounts | HKKKU, DKKKU | ✓ | ✓ |
|
|
313
|
+
| **Electronic Statements** | `getElectronicStatements(account: AccountRef, options?)` | Fetches the statement document from the electronic mailbox, usually a PDF | HKEKA | ✓ | ✓ |
|
|
314
|
+
| **SEPA Credit Transfer** | `transfer(account: AccountRef, transfer: CreditTransfer)` | Sends a SEPA credit transfer, executed as soon as possible, with Verification of Payee where the bank requires it (see [SEPA credit transfers](#sepa-credit-transfers)) | HKCCS, HKVPP, HKVPA | ✓ | ✓ |
|
|
315
|
+
| **TAN Method Selection** | `selectTanMethod(tanMethodId)` | Selects a TAN method by ID from available methods | - | ❌ | ❌ |
|
|
316
|
+
| **TAN Media Selection** | `selectTanMedia(tanMediaName)` | Selects a specific TAN media device by name | - | ❌ | ❌ |
|
|
317
|
+
|
|
318
|
+
### Transaction Support Checking
|
|
319
|
+
|
|
320
|
+
For each account-specific transaction, the client provides corresponding `can*` methods to check if the bank or specific account supports the transaction:
|
|
321
|
+
|
|
322
|
+
| Support Check Method | Purpose |
|
|
323
|
+
| -------------------------------------------- | --------------------------------------------------------------- |
|
|
324
|
+
| `canGetAccountBalance(account?: AccountRef)` | Checks if account balance fetching is supported |
|
|
325
|
+
| `canGetAccountStatements(account?: AccountRef)` | Checks if account statements fetching is supported (MT940/CAMT) |
|
|
326
|
+
| `canGetPortfolio(account?: AccountRef)` | Checks if portfolio information fetching is supported |
|
|
327
|
+
| `canGetCreditCardStatements(account?: AccountRef)` | Checks if credit card statements fetching is supported |
|
|
328
|
+
| `canGetElectronicStatements(account?: AccountRef)` | Checks if electronic account statements fetching is supported |
|
|
329
|
+
| `canTransfer(account?: AccountRef)` | Checks if SEPA credit transfers are supported |
|
|
330
|
+
|
|
331
|
+
### Transaction Parameters
|
|
332
|
+
|
|
333
|
+
The configuration object provides methods to access transaction-specific parameters and capabilities provided by the bank:
|
|
334
|
+
|
|
335
|
+
#### `config.getTransactionParameters<T>(transId: string): T | undefined`
|
|
336
|
+
|
|
337
|
+
Returns the bank-specific parameters for a transaction type, if available. These parameters contain transaction limits, supported formats, and other bank-specific constraints.
|
|
338
|
+
|
|
339
|
+
```typescript
|
|
340
|
+
// Get parameters for account statements (MT940)
|
|
341
|
+
const mt940Params = config.getTransactionParameters<HIKAZSParameter>('HKKAZ');
|
|
342
|
+
|
|
343
|
+
// Get parameters for account statements (CAMT)
|
|
344
|
+
const camtParams = config.getTransactionParameters<HICAZSParameter>('HKCAZ');
|
|
345
|
+
|
|
346
|
+
// Get parameters for SEPA transactions
|
|
347
|
+
const sepaParams = config.getTransactionParameters<HISPASParameter>('HKSPA');
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
#### `config.isTransactionSupported(transId: string): boolean`
|
|
351
|
+
|
|
352
|
+
Checks whether a specific transaction type is supported by the bank.
|
|
353
|
+
|
|
354
|
+
```typescript
|
|
355
|
+
if (config.isTransactionSupported('HKWPD')) {
|
|
356
|
+
console.log('Bank supports portfolio requests');
|
|
357
|
+
}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
#### `config.isAccountTransactionSupported(account: AccountRef, transId: string): boolean`
|
|
361
|
+
|
|
362
|
+
Checks whether a specific transaction type is supported for a particular account.
|
|
363
|
+
|
|
364
|
+
```typescript
|
|
365
|
+
if (config.isAccountTransactionSupported(account, 'HKWPD')) {
|
|
366
|
+
console.log('Account supports portfolio requests');
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**Note**: Transaction IDs correspond to the FinTS segment names (e.g., 'HKKAZ' for account statements, 'HKWPD' for portfolio, 'HKSAL' for balance).
|
|
371
|
+
|
|
372
|
+
### TAN Continuation Methods
|
|
373
|
+
|
|
374
|
+
Every transaction that supports TAN authentication has a corresponding `*WithTan` method for continuing the transaction after TAN entry:
|
|
375
|
+
|
|
376
|
+
- `synchronizeWithTan(tanReference, tan?)`
|
|
377
|
+
- `getAccountBalanceWithTan(tanReference, tan?)`
|
|
378
|
+
- `getAccountStatementsWithTan(tanReference, tan?)`
|
|
379
|
+
- `getPortfolioWithTan(tanReference, tan?)`
|
|
380
|
+
- `getCreditCardStatementsWithTan(tanReference, tan?)`
|
|
381
|
+
- `transferWithTan(tanReference, tan?)`
|
|
382
|
+
|
|
383
|
+
The `tan` parameter can be omitted when using decoupled TAN methods.
|
|
384
|
+
|
|
385
|
+
A transfer can also stop for the user's decision on the Verification of Payee result, before any TAN; `confirmTransfer(transferId)` and `cancelTransfer(transferId)` continue it from there (see [SEPA credit transfers](#sepa-credit-transfers)).
|
|
386
|
+
|
|
387
|
+
## Limitations
|
|
388
|
+
|
|
389
|
+
- Only FinTS 3.0 is supported (older versions may not work)
|
|
390
|
+
- Only PIN/TAN security is supported (including decoupled TAN methods)
|
|
391
|
+
- The only payment is a single SEPA credit transfer executed as soon as possible; instant payments (HKIPZ), batch transfers (HKCCM), scheduled transfers (HKCSE), standing orders and direct debits are not supported yet
|
|
392
|
+
|
|
393
|
+
Implementing further transactions should be straight forward and contributions are highly appreciated
|
|
394
|
+
|
|
395
|
+
### Successfully tested with the following banks
|
|
396
|
+
|
|
397
|
+
- comdirect
|
|
398
|
+
- DKB
|
|
399
|
+
- ING-DiBa
|
|
400
|
+
- Renault Bank Direkt
|
|
401
|
+
|
|
402
|
+
## Built With
|
|
403
|
+
|
|
404
|
+
- [Typescript](https://www.typescriptlang.org/) - Programming Language
|
|
405
|
+
- [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) - XML parsing for CAMT statements and pain.002 payment status reports
|
|
406
|
+
- [Vitest](https://vitest.dev/) - Testing Framework
|
|
407
|
+
- [pnpm](https://pnpm.io/) - Package manager
|
|
408
|
+
|
|
409
|
+
## Contributing
|
|
410
|
+
|
|
411
|
+
Feel free to create an issue if you want to report a bug.
|
|
412
|
+
|
|
413
|
+
If you tested this library with some other bank it would be great to hear from you and update the information on this page
|
|
414
|
+
|
|
415
|
+
As this is a free-time project, a lot of things are still remaining which could be added to this library, especially other kinds of transactions. If you want to contribute with pull-requests this would be highly appreciated
|
|
416
|
+
|
|
417
|
+
## License
|
|
418
|
+
|
|
419
|
+
This project is licensed under the LGPL-2.1-or-later License - see the [LICENSE](LICENSE) file for details
|
|
420
|
+
|
|
421
|
+
## References
|
|
422
|
+
|
|
423
|
+
- [Product Registration](https://www.hbci-zka.de/register/prod_register.htm)
|
|
424
|
+
- [FinTS 3.0 Specification](https://www.hbci-zka.de/spec/3_0.htm)
|
package/biome.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": false,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"includes": ["**", "!!**/dist"]
|
|
10
|
+
},
|
|
11
|
+
"formatter": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"indentStyle": "tab",
|
|
14
|
+
"lineWidth": 100
|
|
15
|
+
},
|
|
16
|
+
"linter": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"rules": {
|
|
19
|
+
"recommended": true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"javascript": {
|
|
23
|
+
"formatter": {
|
|
24
|
+
"quoteStyle": "single"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"assist": {
|
|
28
|
+
"enabled": true,
|
|
29
|
+
"actions": {
|
|
30
|
+
"source": {
|
|
31
|
+
"organizeImports": "on"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { HKSPA } from './segments/HKSPA.js';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the account connection ("Kontoverbindung") a segment carries.
|
|
4
|
+
*
|
|
5
|
+
* FinTS has two forms, and segments pick one by version: the national form (KTV,
|
|
6
|
+
* account number + sub-account + bank) and the international one (KTI, which adds
|
|
7
|
+
* IBAN and BIC and makes every field optional). The international form allows the
|
|
8
|
+
* national fields to be present as well, but only where the bank permits it — and
|
|
9
|
+
* the bank says so in the HISPAS parameters, in `nationalAccountAllowed`.
|
|
10
|
+
*
|
|
11
|
+
* Filling both halves regardless is rejected by banks that set the flag to false.
|
|
12
|
+
* Measured at comdirect (BLZ 2004xxxx), same account, same range, same session:
|
|
13
|
+
*
|
|
14
|
+
* IBAN + BIC + number + sub-account + bank → 3010 "Kontonummer ist ungültig", 0 statements
|
|
15
|
+
* IBAN + BIC → 0020 "Auftrag ausgeführt", 19 statements
|
|
16
|
+
* IBAN → 0020 "Auftrag ausgeführt", 19 statements
|
|
17
|
+
* number + sub-account + bank → 3010 "Kontonummer ist ungültig", 0 statements
|
|
18
|
+
*
|
|
19
|
+
* The last line is why this is a rule about the national *fields* rather than about
|
|
20
|
+
* the combination: the bank rejects them in a KTI even when no IBAN accompanies
|
|
21
|
+
* them.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* The national form. Built field by field rather than by spreading the account and
|
|
25
|
+
* blanking what does not belong: the data group has exactly these three fields, and
|
|
26
|
+
* saying so is clearer than relying on the encoder to ignore the rest.
|
|
27
|
+
*/
|
|
28
|
+
export function nationalAccount(account) {
|
|
29
|
+
return {
|
|
30
|
+
accountNumber: account.accountNumber,
|
|
31
|
+
subAccountId: account.subAccountId,
|
|
32
|
+
bank: account.bank,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The international form. IBAN and BIC always; the national fields only where the
|
|
37
|
+
* bank's HISPAS parameters allow them.
|
|
38
|
+
*
|
|
39
|
+
* An account without an IBAN — a securities account, typically — has nothing else
|
|
40
|
+
* to identify it with, so it keeps the national fields whatever the flag says. A
|
|
41
|
+
* request the bank refuses is more useful than one it cannot resolve at all.
|
|
42
|
+
*
|
|
43
|
+
* A bank that announces no HISPAS at all keeps both halves, exactly as before. The
|
|
44
|
+
* specification would read absent permission as no permission, but this library has
|
|
45
|
+
* already been round that loop: #20 reduced the CAMT descriptor to IBAN and BIC for
|
|
46
|
+
* comdirect, #25 reported Postbank answering "Angaben zur nationalen Kontoverbindung
|
|
47
|
+
* für Identifikation erforderlich", and the reduction was reverted. Only a bank that
|
|
48
|
+
* says `false` gets the shorter form, so no bank that works today can regress on a
|
|
49
|
+
* rule it never stated.
|
|
50
|
+
*/
|
|
51
|
+
export function internationalAccount(config, account) {
|
|
52
|
+
if (!account.iban) {
|
|
53
|
+
return nationalAccount(account);
|
|
54
|
+
}
|
|
55
|
+
const hispas = config.getTransactionParameters(HKSPA.Id);
|
|
56
|
+
return hispas?.nationalAccountAllowed === false
|
|
57
|
+
? { iban: account.iban, bic: account.bic }
|
|
58
|
+
: {
|
|
59
|
+
iban: account.iban,
|
|
60
|
+
bic: account.bic,
|
|
61
|
+
accountNumber: account.accountNumber,
|
|
62
|
+
subAccountId: account.subAccountId,
|
|
63
|
+
bank: account.bank,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export var AccountType;
|
|
2
|
+
(function (AccountType) {
|
|
3
|
+
AccountType["CheckingAccount"] = "CheckingAccount";
|
|
4
|
+
AccountType["SavingsAccount"] = "SavingsAccount";
|
|
5
|
+
AccountType["FixedDepositAccount"] = "FixedDepositAccount";
|
|
6
|
+
AccountType["SecuritiesAccount"] = "SecuritiesAccount";
|
|
7
|
+
AccountType["LoanMortgageAccount"] = "LoanMortgageAccount";
|
|
8
|
+
AccountType["CreditCardAccount"] = "CreditCardAccount";
|
|
9
|
+
AccountType["InvestmentCompanyFund"] = "InvestmentCompanyFund";
|
|
10
|
+
AccountType["HomeSavingsContract"] = "HomeSavingsContract";
|
|
11
|
+
AccountType["InsurancePolicy"] = "InsurancePolicy";
|
|
12
|
+
AccountType["Miscellaneous"] = "Miscellaneous";
|
|
13
|
+
})(AccountType || (AccountType = {}));
|
|
14
|
+
/** How an account reference reads in an error message. */
|
|
15
|
+
export function describeAccount(account) {
|
|
16
|
+
if (typeof account === 'string')
|
|
17
|
+
return account;
|
|
18
|
+
return account.subAccountId
|
|
19
|
+
? `${account.accountNumber} (${account.subAccountId})`
|
|
20
|
+
: account.accountNumber;
|
|
21
|
+
}
|
|
22
|
+
export function finTsAccountTypeToEnum(accountType) {
|
|
23
|
+
if (accountType >= 1 && accountType <= 9)
|
|
24
|
+
return AccountType.CheckingAccount;
|
|
25
|
+
if (accountType >= 10 && accountType <= 19)
|
|
26
|
+
return AccountType.SavingsAccount;
|
|
27
|
+
if (accountType >= 20 && accountType <= 29)
|
|
28
|
+
return AccountType.FixedDepositAccount;
|
|
29
|
+
if (accountType >= 30 && accountType <= 39)
|
|
30
|
+
return AccountType.SecuritiesAccount;
|
|
31
|
+
if (accountType >= 40 && accountType <= 49)
|
|
32
|
+
return AccountType.LoanMortgageAccount;
|
|
33
|
+
if (accountType >= 50 && accountType <= 59)
|
|
34
|
+
return AccountType.CreditCardAccount;
|
|
35
|
+
if (accountType >= 60 && accountType <= 69)
|
|
36
|
+
return AccountType.InvestmentCompanyFund;
|
|
37
|
+
if (accountType >= 70 && accountType <= 79)
|
|
38
|
+
return AccountType.HomeSavingsContract;
|
|
39
|
+
if (accountType >= 80 && accountType <= 89)
|
|
40
|
+
return AccountType.InsurancePolicy;
|
|
41
|
+
return AccountType.Miscellaneous;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/bpd.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|