@lucianpacurar/iso20022.js 0.2.11 → 0.2.12
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/dist/index.d.ts +387 -18
- package/dist/index.js +977 -283
- package/dist/index.mjs +977 -284
- package/dist/src/camt/003/cash-management-get-account.d.ts +2 -2
- package/dist/src/camt/004/cash-management-return-account.d.ts +4 -4
- package/dist/src/camt/005/cash-management-get-transaction.d.ts +2 -2
- package/dist/src/camt/006/cash-management-return-transaction.d.ts +4 -4
- package/dist/src/camt/index.d.ts +5 -5
- package/dist/src/index.d.ts +5 -3
- package/dist/src/iso20022.d.ts +118 -0
- package/dist/src/lib/types.d.ts +56 -0
- package/dist/src/pain/001/payment-initiation.d.ts +2 -2
- package/dist/src/pain/001/sepa-credit-payment-initiation.d.ts +1 -1
- package/dist/src/pain/001/sepa-multi-credit-payment-initiation.d.ts +1 -1
- package/dist/src/pain/008/index.d.ts +2 -0
- package/dist/src/pain/008/sepa-direct-debit-payment-initiation.d.ts +198 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -519,15 +519,71 @@ declare const ACHLocalInstrumentCodeDescriptionMap: {
|
|
|
519
519
|
readonly BOC: "Back Office Conversion";
|
|
520
520
|
readonly RCK: "Represented Check Entry";
|
|
521
521
|
};
|
|
522
|
+
/**
|
|
523
|
+
* SEPA Direct Debit Local Instrument Codes.
|
|
524
|
+
* Defines the type of SEPA direct debit scheme.
|
|
525
|
+
*/
|
|
526
|
+
type SEPALocalInstrument = 'CORE' | 'B2B';
|
|
527
|
+
/**
|
|
528
|
+
* SEPA Direct Debit Sequence Type Codes.
|
|
529
|
+
* Indicates the position of a direct debit transaction in a series of recurring direct debits.
|
|
530
|
+
* - FRST: First collection in a series of recurring direct debits
|
|
531
|
+
* - RCUR: Recurring collection in a series of recurring direct debits
|
|
532
|
+
* - OOFF: One-off direct debit collection
|
|
533
|
+
* - FNAL: Final collection in a series of recurring direct debits
|
|
534
|
+
*/
|
|
535
|
+
type SEPASequenceType = 'FRST' | 'RCUR' | 'OOFF' | 'FNAL';
|
|
536
|
+
/**
|
|
537
|
+
* Information about amendments made to a direct debit mandate.
|
|
538
|
+
*/
|
|
539
|
+
interface MandateAmendmentInformation {
|
|
540
|
+
/** Original mandate identification before amendment */
|
|
541
|
+
originalMandateId?: string;
|
|
542
|
+
/** Original creditor scheme identification before amendment */
|
|
543
|
+
originalCreditorSchemeId?: {
|
|
544
|
+
name?: string;
|
|
545
|
+
id?: string;
|
|
546
|
+
};
|
|
547
|
+
/** Original debtor before amendment */
|
|
548
|
+
originalDebtor?: Party;
|
|
549
|
+
/** Original debtor account before amendment */
|
|
550
|
+
originalDebtorAccount?: Account;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Direct debit mandate information.
|
|
554
|
+
* A mandate is an authorization from a debtor allowing a creditor to collect payments.
|
|
555
|
+
*/
|
|
556
|
+
interface MandateInformation {
|
|
557
|
+
/** Unique mandate identification */
|
|
558
|
+
mandateId: string;
|
|
559
|
+
/** Date when the mandate was signed by the debtor */
|
|
560
|
+
dateOfSignature: Date;
|
|
561
|
+
/** Indicates whether the mandate has been amended */
|
|
562
|
+
amendmentIndicator: boolean;
|
|
563
|
+
/** Amendment details if the mandate has been amended */
|
|
564
|
+
amendmentInformation?: MandateAmendmentInformation;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Represents a SEPA direct debit payment instruction.
|
|
568
|
+
*/
|
|
569
|
+
interface SEPADirectDebitPaymentInstruction extends PaymentInstruction {
|
|
570
|
+
type?: 'sepa';
|
|
571
|
+
direction?: 'debit';
|
|
572
|
+
currency: 'EUR';
|
|
573
|
+
/** The party being debited (money is collected from this party) */
|
|
574
|
+
debtor: Party;
|
|
575
|
+
/** Mandate information authorizing the direct debit */
|
|
576
|
+
mandate: MandateInformation;
|
|
577
|
+
}
|
|
522
578
|
|
|
523
579
|
/**
|
|
524
580
|
* Abstract base class for ISO20022 payment initiation (PAIN) messages.
|
|
525
581
|
* @abstract
|
|
526
582
|
*/
|
|
527
583
|
declare abstract class PaymentInitiation {
|
|
528
|
-
type:
|
|
584
|
+
type: 'swift' | 'rtp' | 'sepa' | 'ach';
|
|
529
585
|
constructor({ type }: {
|
|
530
|
-
type:
|
|
586
|
+
type: 'swift' | 'rtp' | 'sepa' | 'ach';
|
|
531
587
|
});
|
|
532
588
|
/**
|
|
533
589
|
* Serializes the payment initiation to a string format.
|
|
@@ -624,7 +680,7 @@ declare abstract class PaymentInitiation {
|
|
|
624
680
|
static getBuilder(): XMLBuilder;
|
|
625
681
|
}
|
|
626
682
|
|
|
627
|
-
type AtLeastOne$
|
|
683
|
+
type AtLeastOne$6<T> = [T, ...T[]];
|
|
628
684
|
/**
|
|
629
685
|
* Configuration for SWIFT Credit Payment Initiation.
|
|
630
686
|
*
|
|
@@ -637,7 +693,7 @@ interface SWIFTCreditPaymentInitiationConfig$1 {
|
|
|
637
693
|
/** The party initiating the payment. */
|
|
638
694
|
initiatingParty: Party;
|
|
639
695
|
/** An array of payment instructions. */
|
|
640
|
-
paymentInstructions: AtLeastOne$
|
|
696
|
+
paymentInstructions: AtLeastOne$6<SWIFTCreditPaymentInstruction>;
|
|
641
697
|
/** Optional unique identifier for the message. If not provided, a UUID will be generated. */
|
|
642
698
|
messageId?: string;
|
|
643
699
|
/** Optional creation date for the message. If not provided, current date will be used. */
|
|
@@ -694,7 +750,7 @@ declare class SWIFTCreditPaymentInitiation extends PaymentInitiation {
|
|
|
694
750
|
serialize(): string;
|
|
695
751
|
}
|
|
696
752
|
|
|
697
|
-
type AtLeastOne$
|
|
753
|
+
type AtLeastOne$5<T> = [T, ...T[]];
|
|
698
754
|
/**
|
|
699
755
|
* Configuration for SEPA Credit Payment Initiation.
|
|
700
756
|
*
|
|
@@ -708,7 +764,7 @@ interface SEPACreditPaymentInitiationConfig$1 {
|
|
|
708
764
|
/** The party initiating the SEPA credit transfer. */
|
|
709
765
|
initiatingParty: Party;
|
|
710
766
|
/** An array containing at least one payment instruction for SEPA credit transfer. */
|
|
711
|
-
paymentInstructions: AtLeastOne$
|
|
767
|
+
paymentInstructions: AtLeastOne$5<SEPACreditPaymentInstruction>;
|
|
712
768
|
/** Optional unique identifier for the message. If not provided, a UUID will be generated. */
|
|
713
769
|
messageId?: string;
|
|
714
770
|
/** Optional creation date for the message. If not provided, current date will be used. */
|
|
@@ -741,7 +797,7 @@ declare class SEPACreditPaymentInitiation extends PaymentInitiation {
|
|
|
741
797
|
initiatingParty: Party;
|
|
742
798
|
messageId: string;
|
|
743
799
|
creationDate: Date;
|
|
744
|
-
paymentInstructions: AtLeastOne$
|
|
800
|
+
paymentInstructions: AtLeastOne$5<SEPACreditPaymentInstruction>;
|
|
745
801
|
paymentInformationId: string;
|
|
746
802
|
categoryPurpose?: ExternalCategoryPurpose;
|
|
747
803
|
private formattedPaymentSum;
|
|
@@ -818,7 +874,7 @@ declare class SEPACreditPaymentInitiation extends PaymentInitiation {
|
|
|
818
874
|
static fromXML(rawXml: string): SEPACreditPaymentInitiation;
|
|
819
875
|
}
|
|
820
876
|
|
|
821
|
-
type AtLeastOne$
|
|
877
|
+
type AtLeastOne$4<T> = [T, ...T[]];
|
|
822
878
|
/**
|
|
823
879
|
* Represents a group of payment instructions for a single debtor (PmtInf block).
|
|
824
880
|
*
|
|
@@ -830,7 +886,7 @@ interface SEPAMultiCreditPaymentInstructionGroup {
|
|
|
830
886
|
/** The party (debtor) for this specific payment information block. */
|
|
831
887
|
initiatingParty: Party;
|
|
832
888
|
/** An array containing at least one payment instruction for this debtor. */
|
|
833
|
-
payments: AtLeastOne$
|
|
889
|
+
payments: AtLeastOne$4<SEPACreditPaymentInstruction>;
|
|
834
890
|
/** Optional category purpose code for this payment information block. */
|
|
835
891
|
categoryPurpose?: ExternalCategoryPurpose;
|
|
836
892
|
}
|
|
@@ -846,7 +902,7 @@ interface SEPAMultiCreditPaymentInitiationConfig$1 {
|
|
|
846
902
|
/** The top-level party initiating the message (used in GrpHdr). */
|
|
847
903
|
initiatingParty: Party;
|
|
848
904
|
/** An array containing at least one payment instruction group. */
|
|
849
|
-
paymentInstructions: AtLeastOne$
|
|
905
|
+
paymentInstructions: AtLeastOne$4<SEPAMultiCreditPaymentInstructionGroup>;
|
|
850
906
|
/** Optional unique identifier for the message. If not provided, a UUID will be generated. */
|
|
851
907
|
messageId?: string;
|
|
852
908
|
/** Optional creation date for the message. If not provided, current date will be used. */
|
|
@@ -881,7 +937,7 @@ declare class SEPAMultiCreditPaymentInitiation extends PaymentInitiation {
|
|
|
881
937
|
initiatingParty: Party;
|
|
882
938
|
messageId: string;
|
|
883
939
|
creationDate: Date;
|
|
884
|
-
paymentInstructions: AtLeastOne$
|
|
940
|
+
paymentInstructions: AtLeastOne$4<SEPAMultiCreditPaymentInstructionGroup>;
|
|
885
941
|
paymentInformationIdBase: string;
|
|
886
942
|
private formattedPaymentSum;
|
|
887
943
|
private totalTransactionCount;
|
|
@@ -975,7 +1031,7 @@ declare class SEPAMultiCreditPaymentInitiation extends PaymentInitiation {
|
|
|
975
1031
|
static fromXML(rawXml: string): SEPAMultiCreditPaymentInitiation;
|
|
976
1032
|
}
|
|
977
1033
|
|
|
978
|
-
type AtLeastOne$
|
|
1034
|
+
type AtLeastOne$3<T> = [T, ...T[]];
|
|
979
1035
|
/**
|
|
980
1036
|
* Configuration for RTP Credit Payment Initiation.
|
|
981
1037
|
*
|
|
@@ -988,7 +1044,7 @@ interface RTPCreditPaymentInitiationConfig$1 {
|
|
|
988
1044
|
/** The party initiating the RTP credit transfer. */
|
|
989
1045
|
initiatingParty: Party;
|
|
990
1046
|
/** Array containing at least one payment instruction for the RTP credit transfer. */
|
|
991
|
-
paymentInstructions: AtLeastOne$
|
|
1047
|
+
paymentInstructions: AtLeastOne$3<RTPCreditPaymentInstruction>;
|
|
992
1048
|
/** Optional unique identifier for the message. If not provided, a UUID will be generated. */
|
|
993
1049
|
messageId?: string;
|
|
994
1050
|
/** Optional creation date for the message. If not provided, current date will be used. */
|
|
@@ -1017,7 +1073,7 @@ interface RTPCreditPaymentInitiationConfig$1 {
|
|
|
1017
1073
|
*/
|
|
1018
1074
|
declare class RTPCreditPaymentInitiation extends PaymentInitiation {
|
|
1019
1075
|
initiatingParty: Party;
|
|
1020
|
-
paymentInstructions: AtLeastOne$
|
|
1076
|
+
paymentInstructions: AtLeastOne$3<RTPCreditPaymentInstruction>;
|
|
1021
1077
|
messageId: string;
|
|
1022
1078
|
creationDate: Date;
|
|
1023
1079
|
paymentInformationId: string;
|
|
@@ -1091,7 +1147,7 @@ declare class RTPCreditPaymentInitiation extends PaymentInitiation {
|
|
|
1091
1147
|
static fromXML(rawXml: string): RTPCreditPaymentInitiation;
|
|
1092
1148
|
}
|
|
1093
1149
|
|
|
1094
|
-
type AtLeastOne$
|
|
1150
|
+
type AtLeastOne$2<T> = [T, ...T[]];
|
|
1095
1151
|
/**
|
|
1096
1152
|
* Configuration for ACH Credit Payment Initiation.
|
|
1097
1153
|
*
|
|
@@ -1104,7 +1160,7 @@ interface ACHCreditPaymentInitiationConfig$1 {
|
|
|
1104
1160
|
/** The party initiating the ACH credit transfer. */
|
|
1105
1161
|
initiatingParty: Party;
|
|
1106
1162
|
/** Array containing at least one payment instruction for the ACH credit transfer. */
|
|
1107
|
-
paymentInstructions: AtLeastOne$
|
|
1163
|
+
paymentInstructions: AtLeastOne$2<ACHCreditPaymentInstruction>;
|
|
1108
1164
|
/** Optional unique identifier for the message. If not provided, a UUID will be generated. */
|
|
1109
1165
|
messageId?: string;
|
|
1110
1166
|
/** Optional creation date for the message. If not provided, current date will be used. */
|
|
@@ -1159,7 +1215,7 @@ interface ACHCreditPaymentInitiationConfig$1 {
|
|
|
1159
1215
|
*/
|
|
1160
1216
|
declare class ACHCreditPaymentInitiation extends PaymentInitiation {
|
|
1161
1217
|
initiatingParty: Party;
|
|
1162
|
-
paymentInstructions: AtLeastOne$
|
|
1218
|
+
paymentInstructions: AtLeastOne$2<ACHCreditPaymentInstruction>;
|
|
1163
1219
|
messageId: string;
|
|
1164
1220
|
creationDate: Date;
|
|
1165
1221
|
paymentInformationId: string;
|
|
@@ -1248,6 +1304,202 @@ declare class ACHCreditPaymentInitiation extends PaymentInitiation {
|
|
|
1248
1304
|
static fromXML(rawXml: string): ACHCreditPaymentInitiation;
|
|
1249
1305
|
}
|
|
1250
1306
|
|
|
1307
|
+
type AtLeastOne$1<T> = [T, ...T[]];
|
|
1308
|
+
/**
|
|
1309
|
+
* Represents a group of direct debit payment instructions for a single creditor (PmtInf block).
|
|
1310
|
+
*
|
|
1311
|
+
* @property {Party} creditor - The party collecting money from debtors.
|
|
1312
|
+
* @property {string} creditorSchemeId - The creditor's SEPA scheme identifier (e.g., "DE96ZZZ00000345986").
|
|
1313
|
+
* @property {AtLeastOne<SEPADirectDebitPaymentInstruction>} payments - An array containing at least one payment instruction for this creditor.
|
|
1314
|
+
* @property {Date} requestedCollectionDate - The date when funds should be collected from all debtors in this group.
|
|
1315
|
+
* @property {SEPASequenceType} sequenceType - Sequence type indicating the position in a series of direct debits (FRST, RCUR, OOFF, FNAL).
|
|
1316
|
+
* @property {SEPALocalInstrument} [localInstrument] - The SEPA direct debit scheme (CORE or B2B). Defaults to 'CORE'.
|
|
1317
|
+
* @property {ExternalCategoryPurpose} [categoryPurpose] - Optional category purpose code for this payment information block.
|
|
1318
|
+
* @property {boolean} [batchBooking] - Indicates whether transactions should be booked in batch. Defaults to false.
|
|
1319
|
+
*/
|
|
1320
|
+
interface SEPADirectDebitPaymentInstructionGroup {
|
|
1321
|
+
/** The party collecting money from debtors. */
|
|
1322
|
+
creditor: Party;
|
|
1323
|
+
/** The creditor's SEPA scheme identifier. */
|
|
1324
|
+
creditorSchemeId: string;
|
|
1325
|
+
/** An array containing at least one direct debit instruction. */
|
|
1326
|
+
payments: AtLeastOne$1<SEPADirectDebitPaymentInstruction>;
|
|
1327
|
+
/** The date when funds should be collected from all debtors. */
|
|
1328
|
+
requestedCollectionDate: Date;
|
|
1329
|
+
/** Sequence type for all transactions in this group (FRST, RCUR, OOFF, FNAL). */
|
|
1330
|
+
sequenceType: SEPASequenceType;
|
|
1331
|
+
/** The SEPA direct debit scheme (CORE or B2B). Defaults to 'CORE'. */
|
|
1332
|
+
localInstrument?: SEPALocalInstrument;
|
|
1333
|
+
/** Optional category purpose code for this payment information block. */
|
|
1334
|
+
categoryPurpose?: ExternalCategoryPurpose;
|
|
1335
|
+
/** Indicates whether transactions should be booked in batch. Defaults to false. */
|
|
1336
|
+
batchBooking?: boolean;
|
|
1337
|
+
}
|
|
1338
|
+
/**
|
|
1339
|
+
* Configuration for SEPA Direct Debit Payment Initiation.
|
|
1340
|
+
*
|
|
1341
|
+
* @property {Party} initiatingParty - The top-level party initiating the message (used in GrpHdr).
|
|
1342
|
+
* @property {AtLeastOne<SEPADirectDebitPaymentInstructionGroup>} paymentInstructions - An array containing at least one payment instruction group.
|
|
1343
|
+
* @property {string} [messageId] - Optional unique identifier for the message. If not provided, a UUID will be generated.
|
|
1344
|
+
* @property {Date} [creationDate] - Optional creation date for the message. If not provided, current date will be used.
|
|
1345
|
+
*/
|
|
1346
|
+
interface SEPADirectDebitPaymentInitiationConfig$1 {
|
|
1347
|
+
/** The top-level party initiating the message (used in GrpHdr). */
|
|
1348
|
+
initiatingParty: Party;
|
|
1349
|
+
/** An array containing at least one payment instruction group. */
|
|
1350
|
+
paymentInstructions: AtLeastOne$1<SEPADirectDebitPaymentInstructionGroup>;
|
|
1351
|
+
/** Optional unique identifier for the message. If not provided, a UUID will be generated. */
|
|
1352
|
+
messageId?: string;
|
|
1353
|
+
/** Optional creation date for the message. If not provided, current date will be used. */
|
|
1354
|
+
creationDate?: Date;
|
|
1355
|
+
}
|
|
1356
|
+
/**
|
|
1357
|
+
* Represents a SEPA Direct Debit Payment Initiation.
|
|
1358
|
+
* This class handles the creation and serialization of SEPA direct debit messages
|
|
1359
|
+
* with multiple payment information blocks (multiple creditors) according to the ISO20022 pain.008 standard.
|
|
1360
|
+
* @class
|
|
1361
|
+
* @extends PaymentInitiation
|
|
1362
|
+
* @param {SEPADirectDebitPaymentInitiationConfig} config - The configuration for the SEPA Direct Debit Payment Initiation message.
|
|
1363
|
+
* @example
|
|
1364
|
+
* ```typescript
|
|
1365
|
+
* // Creating a SEPA direct debit message
|
|
1366
|
+
* const payment = new SEPADirectDebitPaymentInitiation({
|
|
1367
|
+
* initiatingParty: { name: 'Company Ltd', id: '12345' },
|
|
1368
|
+
* paymentInstructions: [
|
|
1369
|
+
* {
|
|
1370
|
+
* creditor: creditor1,
|
|
1371
|
+
* creditorSchemeId: 'DE96ZZZ00000345986',
|
|
1372
|
+
* requestedCollectionDate: new Date('2025-11-22'),
|
|
1373
|
+
* sequenceType: 'RCUR',
|
|
1374
|
+
* payments: [debit1, debit2]
|
|
1375
|
+
* }
|
|
1376
|
+
* ]
|
|
1377
|
+
* });
|
|
1378
|
+
* ```
|
|
1379
|
+
*/
|
|
1380
|
+
declare class SEPADirectDebitPaymentInitiation extends PaymentInitiation {
|
|
1381
|
+
initiatingParty: Party;
|
|
1382
|
+
messageId: string;
|
|
1383
|
+
creationDate: Date;
|
|
1384
|
+
paymentInstructions: AtLeastOne$1<SEPADirectDebitPaymentInstructionGroup>;
|
|
1385
|
+
paymentInformationIdBase: string;
|
|
1386
|
+
private formattedPaymentSum;
|
|
1387
|
+
private totalTransactionCount;
|
|
1388
|
+
/**
|
|
1389
|
+
* Creates an instance of SEPADirectDebitPaymentInitiation.
|
|
1390
|
+
* @param {SEPADirectDebitPaymentInitiationConfig} config - The configuration object for the SEPA direct debit.
|
|
1391
|
+
*/
|
|
1392
|
+
constructor(config: SEPADirectDebitPaymentInitiationConfig$1);
|
|
1393
|
+
/**
|
|
1394
|
+
* Counts the total number of transactions across all payment instruction groups.
|
|
1395
|
+
* @private
|
|
1396
|
+
* @returns {number} The total count of all transactions.
|
|
1397
|
+
*/
|
|
1398
|
+
private countAllTransactions;
|
|
1399
|
+
/**
|
|
1400
|
+
* Calculates the sum of all payment instructions across all groups.
|
|
1401
|
+
* @private
|
|
1402
|
+
* @returns {string} The total sum formatted as a string with 2 decimal places.
|
|
1403
|
+
*/
|
|
1404
|
+
private sumAllPayments;
|
|
1405
|
+
/**
|
|
1406
|
+
* Validates the payment initiation data according to SEPA requirements.
|
|
1407
|
+
* @private
|
|
1408
|
+
* @throws {Error} If messageId exceeds 35 characters.
|
|
1409
|
+
* @throws {Error} If any group's payment instructions have different currencies.
|
|
1410
|
+
*/
|
|
1411
|
+
private validate;
|
|
1412
|
+
/**
|
|
1413
|
+
* Validates that all payment instructions in a group have the same currency (EUR).
|
|
1414
|
+
* @private
|
|
1415
|
+
* @param {AtLeastOne<SEPADirectDebitPaymentInstruction>} payments - Array of payment instructions.
|
|
1416
|
+
* @throws {Error} If payment instructions have different currencies.
|
|
1417
|
+
*/
|
|
1418
|
+
private validateGroupInstructionsHaveSameCurrency;
|
|
1419
|
+
/**
|
|
1420
|
+
* Generates payment information for a single SEPA direct debit transfer instruction.
|
|
1421
|
+
* @param {SEPADirectDebitPaymentInstruction} instruction - The payment instruction.
|
|
1422
|
+
* @returns {Object} The payment information object formatted according to SEPA direct debit specifications.
|
|
1423
|
+
*/
|
|
1424
|
+
directDebitTransfer(instruction: SEPADirectDebitPaymentInstruction): {
|
|
1425
|
+
RmtInf?: {
|
|
1426
|
+
Ustrd: string;
|
|
1427
|
+
} | undefined;
|
|
1428
|
+
PmtId: {
|
|
1429
|
+
EndToEndId: string;
|
|
1430
|
+
};
|
|
1431
|
+
InstdAmt: {
|
|
1432
|
+
'#': string;
|
|
1433
|
+
'@Ccy': "EUR";
|
|
1434
|
+
};
|
|
1435
|
+
DrctDbtTx: {
|
|
1436
|
+
MndtRltdInf: {
|
|
1437
|
+
AmdmntInfDtls?: {
|
|
1438
|
+
OrgnlCdtrSchmeId?: {
|
|
1439
|
+
Id?: {
|
|
1440
|
+
PrvtId: {
|
|
1441
|
+
Othr: {
|
|
1442
|
+
Id: string;
|
|
1443
|
+
SchmeNm: {
|
|
1444
|
+
Prtry: string;
|
|
1445
|
+
};
|
|
1446
|
+
};
|
|
1447
|
+
};
|
|
1448
|
+
} | undefined;
|
|
1449
|
+
Nm?: string | undefined;
|
|
1450
|
+
} | undefined;
|
|
1451
|
+
OrgnlMndtId?: string | undefined;
|
|
1452
|
+
} | undefined;
|
|
1453
|
+
MndtId: string;
|
|
1454
|
+
DtOfSgntr: string;
|
|
1455
|
+
AmdmntInd: boolean;
|
|
1456
|
+
};
|
|
1457
|
+
};
|
|
1458
|
+
DbtrAgt: {
|
|
1459
|
+
FinInstnId: {
|
|
1460
|
+
BIC: string;
|
|
1461
|
+
ClrSysMmbId?: undefined;
|
|
1462
|
+
};
|
|
1463
|
+
} | {
|
|
1464
|
+
FinInstnId: {
|
|
1465
|
+
ClrSysMmbId: {
|
|
1466
|
+
ClrSysId: {
|
|
1467
|
+
Cd: string;
|
|
1468
|
+
};
|
|
1469
|
+
MmbId: string;
|
|
1470
|
+
};
|
|
1471
|
+
BIC?: undefined;
|
|
1472
|
+
};
|
|
1473
|
+
};
|
|
1474
|
+
Dbtr: any;
|
|
1475
|
+
DbtrAcct: {
|
|
1476
|
+
Id: {
|
|
1477
|
+
IBAN: string;
|
|
1478
|
+
};
|
|
1479
|
+
} | {
|
|
1480
|
+
Id: {
|
|
1481
|
+
Othr: {
|
|
1482
|
+
Id: string;
|
|
1483
|
+
};
|
|
1484
|
+
};
|
|
1485
|
+
};
|
|
1486
|
+
};
|
|
1487
|
+
/**
|
|
1488
|
+
* Serializes the SEPA direct debit initiation to an XML string.
|
|
1489
|
+
* @returns {string} The XML representation of the SEPA direct debit initiation.
|
|
1490
|
+
*/
|
|
1491
|
+
serialize(): string;
|
|
1492
|
+
/**
|
|
1493
|
+
* Parses an XML string and creates a SEPADirectDebitPaymentInitiation instance.
|
|
1494
|
+
* Supports multiple PmtInf blocks in the XML document.
|
|
1495
|
+
* @param {string} rawXml - The XML string to parse.
|
|
1496
|
+
* @returns {SEPADirectDebitPaymentInitiation} A new instance created from the XML data.
|
|
1497
|
+
* @throws {InvalidXmlError} If the XML format is invalid.
|
|
1498
|
+
* @throws {InvalidXmlNamespaceError} If the namespace is not pain.008.
|
|
1499
|
+
*/
|
|
1500
|
+
static fromXML(rawXml: string): SEPADirectDebitPaymentInitiation;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1251
1503
|
type ISO20022MessageTypeName = `${string}.${string}`;
|
|
1252
1504
|
interface GenericISO20022Message {
|
|
1253
1505
|
/** serialize to XML string */
|
|
@@ -1688,6 +1940,72 @@ interface ACHCreditPaymentInitiationConfig {
|
|
|
1688
1940
|
*/
|
|
1689
1941
|
creationDate?: Date;
|
|
1690
1942
|
}
|
|
1943
|
+
/**
|
|
1944
|
+
* Configuration interface for SEPA Direct Debit Payment Initiation.
|
|
1945
|
+
* @interface SEPADirectDebitPaymentInitiationConfig
|
|
1946
|
+
* @example
|
|
1947
|
+
* const config: SEPADirectDebitPaymentInitiationConfig = {
|
|
1948
|
+
* paymentInstructions: [
|
|
1949
|
+
* {
|
|
1950
|
+
* creditor: {
|
|
1951
|
+
* name: 'Landlord Company Ltd',
|
|
1952
|
+
* account: {
|
|
1953
|
+
* iban: 'DE54120300001030860744',
|
|
1954
|
+
* },
|
|
1955
|
+
* agent: {
|
|
1956
|
+
* bic: 'BYLADEM1001',
|
|
1957
|
+
* },
|
|
1958
|
+
* },
|
|
1959
|
+
* creditorSchemeId: 'DE96ZZZ00000345986',
|
|
1960
|
+
* requestedCollectionDate: new Date('2025-11-22'),
|
|
1961
|
+
* sequenceType: 'RCUR',
|
|
1962
|
+
* payments: [
|
|
1963
|
+
* {
|
|
1964
|
+
* type: 'sepa',
|
|
1965
|
+
* direction: 'debit',
|
|
1966
|
+
* amount: 31700, // €317.00 Euros
|
|
1967
|
+
* currency: 'EUR',
|
|
1968
|
+
* debtor: {
|
|
1969
|
+
* name: 'John Doe',
|
|
1970
|
+
* account: {
|
|
1971
|
+
* iban: 'DE20120300001088243355',
|
|
1972
|
+
* },
|
|
1973
|
+
* agent: {
|
|
1974
|
+
* bic: 'BYLADEM1001',
|
|
1975
|
+
* },
|
|
1976
|
+
* },
|
|
1977
|
+
* mandate: {
|
|
1978
|
+
* mandateId: 'MR-12345-001',
|
|
1979
|
+
* dateOfSignature: new Date('2024-01-15'),
|
|
1980
|
+
* amendmentIndicator: false,
|
|
1981
|
+
* },
|
|
1982
|
+
* remittanceInformation: 'Rent payment November 2024',
|
|
1983
|
+
* },
|
|
1984
|
+
* ],
|
|
1985
|
+
* localInstrument: 'CORE', // Optional, defaults to CORE
|
|
1986
|
+
* },
|
|
1987
|
+
* ],
|
|
1988
|
+
* messageId: 'MSGID123', // Optional
|
|
1989
|
+
* creationDate: new Date(), // Optional
|
|
1990
|
+
* };
|
|
1991
|
+
*/
|
|
1992
|
+
interface SEPADirectDebitPaymentInitiationConfig {
|
|
1993
|
+
/**
|
|
1994
|
+
* An array of payment instruction groups, each with its own creditor.
|
|
1995
|
+
* @type {AtLeastOne<SEPADirectDebitPaymentInstructionGroup>}
|
|
1996
|
+
*/
|
|
1997
|
+
paymentInstructions: AtLeastOne<SEPADirectDebitPaymentInstructionGroup>;
|
|
1998
|
+
/**
|
|
1999
|
+
* Optional unique identifier for the message. If not provided, a UUID will be generated.
|
|
2000
|
+
* @type {string}
|
|
2001
|
+
*/
|
|
2002
|
+
messageId?: string;
|
|
2003
|
+
/**
|
|
2004
|
+
* Optional creation date for the message. If not provided, current date will be used.
|
|
2005
|
+
* @type {Date}
|
|
2006
|
+
*/
|
|
2007
|
+
creationDate?: Date;
|
|
2008
|
+
}
|
|
1691
2009
|
/**
|
|
1692
2010
|
* Represents an ISO20022 core message creator.
|
|
1693
2011
|
* This class provides methods to create various basic ISO20022 compliant messages.
|
|
@@ -1871,6 +2189,57 @@ declare class ISO20022 {
|
|
|
1871
2189
|
* @returns {ACHCreditPaymentInitiation} A new ACH Credit Payment Initiation object.
|
|
1872
2190
|
*/
|
|
1873
2191
|
createACHCreditPaymentInitiation(config: ACHCreditPaymentInitiationConfig): ACHCreditPaymentInitiation;
|
|
2192
|
+
/**
|
|
2193
|
+
* Creates a SEPA Direct Debit Payment Initiation message.
|
|
2194
|
+
* @param {SEPADirectDebitPaymentInitiationConfig} config - Configuration containing payment instruction groups and optional parameters.
|
|
2195
|
+
* @example
|
|
2196
|
+
* const payment = iso20022.createSEPADirectDebitPaymentInitiation({
|
|
2197
|
+
* paymentInstructions: [
|
|
2198
|
+
* {
|
|
2199
|
+
* creditor: {
|
|
2200
|
+
* name: 'Landlord Company Ltd',
|
|
2201
|
+
* account: {
|
|
2202
|
+
* iban: 'DE54120300001030860744',
|
|
2203
|
+
* },
|
|
2204
|
+
* agent: {
|
|
2205
|
+
* bic: 'BYLADEM1001',
|
|
2206
|
+
* },
|
|
2207
|
+
* },
|
|
2208
|
+
* creditorSchemeId: 'DE96ZZZ00000345986',
|
|
2209
|
+
* requestedCollectionDate: new Date('2025-11-22'),
|
|
2210
|
+
* sequenceType: 'RCUR',
|
|
2211
|
+
* payments: [
|
|
2212
|
+
* {
|
|
2213
|
+
* type: 'sepa',
|
|
2214
|
+
* direction: 'debit',
|
|
2215
|
+
* amount: 31700, // €317.00 Euros
|
|
2216
|
+
* currency: 'EUR',
|
|
2217
|
+
* debtor: {
|
|
2218
|
+
* name: 'John Doe',
|
|
2219
|
+
* account: {
|
|
2220
|
+
* iban: 'DE20120300001088243355',
|
|
2221
|
+
* },
|
|
2222
|
+
* agent: {
|
|
2223
|
+
* bic: 'BYLADEM1001',
|
|
2224
|
+
* },
|
|
2225
|
+
* },
|
|
2226
|
+
* mandate: {
|
|
2227
|
+
* mandateId: 'MR-12345-001',
|
|
2228
|
+
* dateOfSignature: new Date('2024-01-15'),
|
|
2229
|
+
* amendmentIndicator: false,
|
|
2230
|
+
* },
|
|
2231
|
+
* remittanceInformation: 'Rent payment November 2024',
|
|
2232
|
+
* },
|
|
2233
|
+
* ],
|
|
2234
|
+
* localInstrument: 'CORE', // Optional
|
|
2235
|
+
* },
|
|
2236
|
+
* ],
|
|
2237
|
+
* messageId: 'DD-MSG-001', // Optional
|
|
2238
|
+
* creationDate: new Date('2025-03-01'), // Optional
|
|
2239
|
+
* });
|
|
2240
|
+
* @returns {SEPADirectDebitPaymentInitiation} A new SEPA Direct Debit Payment Initiation object.
|
|
2241
|
+
*/
|
|
2242
|
+
createSEPADirectDebitPaymentInitiation(config: SEPADirectDebitPaymentInitiationConfig): SEPADirectDebitPaymentInitiation;
|
|
1874
2243
|
/** Create a message CAMT or other */
|
|
1875
2244
|
createMessage(type: ISO20022MessageTypeName, config: any): GenericISO20022Message;
|
|
1876
2245
|
}
|
|
@@ -2131,4 +2500,4 @@ declare class InvalidXmlNamespaceError extends Iso20022JsError {
|
|
|
2131
2500
|
constructor(message: string);
|
|
2132
2501
|
}
|
|
2133
2502
|
|
|
2134
|
-
export { type ABAAgent, ACHCreditPaymentInitiation, type ACHCreditPaymentInitiationConfig$1 as ACHCreditPaymentInitiationConfig, type ACHCreditPaymentInstruction, type ACHLocalInstrument, ACHLocalInstrumentCode, ACHLocalInstrumentCodeDescriptionMap, type Account, type Agent, type BICAgent, type Balance, type BalanceType, BalanceTypeCode, BalanceTypeCodeDescriptionMap, type BaseAccount, type BaseStatusInformation as BaseStatus, CashManagementEndOfDayReport, type Entry, type GroupStatusInformation as GroupStatus, type IBANAccount, ISO20022, InvalidXmlError, InvalidXmlNamespaceError, Iso20022JsError, type OriginalGroupInformation, type Party, type PaymentStatusInformation as PaymentStatus, PaymentStatusCode, PaymentStatusReport, RTPCreditPaymentInitiation, type RTPCreditPaymentInitiationConfig$1 as RTPCreditPaymentInitiationConfig, type RTPCreditPaymentInstruction, SEPACreditPaymentInitiation, type SEPACreditPaymentInitiationConfig$1 as SEPACreditPaymentInitiationConfig, type SEPACreditPaymentInstruction, SEPAMultiCreditPaymentInitiation, type SEPAMultiCreditPaymentInitiationConfig$1 as SEPAMultiCreditPaymentInitiationConfig, type SEPAMultiCreditPaymentInstructionGroup, SWIFTCreditPaymentInitiation, type SWIFTCreditPaymentInitiationConfig$1 as SWIFTCreditPaymentInitiationConfig, type SWIFTCreditPaymentInstruction, type Statement, type PaymentStatus as Status, type StatusInformation, type StatusType, type StructuredAddress, type Transaction, type TransactionStatusInformation as TransactionStatus };
|
|
2503
|
+
export { type ABAAgent, ACHCreditPaymentInitiation, type ACHCreditPaymentInitiationConfig$1 as ACHCreditPaymentInitiationConfig, type ACHCreditPaymentInstruction, type ACHLocalInstrument, ACHLocalInstrumentCode, ACHLocalInstrumentCodeDescriptionMap, type Account, type Agent, type BICAgent, type Balance, type BalanceType, BalanceTypeCode, BalanceTypeCodeDescriptionMap, type BaseAccount, type BaseStatusInformation as BaseStatus, CashManagementEndOfDayReport, type Entry, type GroupStatusInformation as GroupStatus, type IBANAccount, ISO20022, InvalidXmlError, InvalidXmlNamespaceError, Iso20022JsError, type MandateAmendmentInformation, type MandateInformation, type OriginalGroupInformation, type Party, type PaymentStatusInformation as PaymentStatus, PaymentStatusCode, PaymentStatusReport, RTPCreditPaymentInitiation, type RTPCreditPaymentInitiationConfig$1 as RTPCreditPaymentInitiationConfig, type RTPCreditPaymentInstruction, SEPACreditPaymentInitiation, type SEPACreditPaymentInitiationConfig$1 as SEPACreditPaymentInitiationConfig, type SEPACreditPaymentInstruction, SEPADirectDebitPaymentInitiation, type SEPADirectDebitPaymentInitiationConfig$1 as SEPADirectDebitPaymentInitiationConfig, type SEPADirectDebitPaymentInstruction, type SEPADirectDebitPaymentInstructionGroup, type SEPALocalInstrument, SEPAMultiCreditPaymentInitiation, type SEPAMultiCreditPaymentInitiationConfig$1 as SEPAMultiCreditPaymentInitiationConfig, type SEPAMultiCreditPaymentInstructionGroup, type SEPASequenceType, SWIFTCreditPaymentInitiation, type SWIFTCreditPaymentInitiationConfig$1 as SWIFTCreditPaymentInitiationConfig, type SWIFTCreditPaymentInstruction, type Statement, type PaymentStatus as Status, type StatusInformation, type StatusType, type StructuredAddress, type Transaction, type TransactionStatusInformation as TransactionStatus };
|