@lucianpacurar/iso20022.js 0.2.7
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/LICENSE +21 -0
- package/README.md +212 -0
- package/dist/index.d.ts +1896 -0
- package/dist/index.js +10039 -0
- package/dist/index.mjs +10023 -0
- package/dist/src/camt/003/cash-management-get-account.d.ts +26 -0
- package/dist/src/camt/004/cash-management-return-account.d.ts +30 -0
- package/dist/src/camt/005/cash-management-get-transaction.d.ts +26 -0
- package/dist/src/camt/006/cash-management-return-transaction.d.ts +43 -0
- package/dist/src/camt/053/cash-management-end-of-day-report.d.ts +90 -0
- package/dist/src/camt/index.d.ts +5 -0
- package/dist/src/camt/types.d.ts +191 -0
- package/dist/src/camt/utils.d.ts +12 -0
- package/dist/src/errors.d.ts +24 -0
- package/dist/src/index.d.ts +61 -0
- package/dist/src/iso20022.d.ts +375 -0
- package/dist/src/lib/countries.d.ts +254 -0
- package/dist/src/lib/currencies.d.ts +1 -0
- package/dist/src/lib/index.d.ts +4 -0
- package/dist/src/lib/interfaces.d.ts +30 -0
- package/dist/src/lib/types.d.ts +376 -0
- package/dist/src/pain/001/ach-credit-payment-initiation.d.ts +159 -0
- package/dist/src/pain/001/payment-initiation.d.ts +105 -0
- package/dist/src/pain/001/rtp-credit-payment-initiation.d.ts +118 -0
- package/dist/src/pain/001/sepa-credit-payment-initiation.d.ts +126 -0
- package/dist/src/pain/001/swift-credit-payment-initiation.d.ts +72 -0
- package/dist/src/pain/002/payment-status-report.d.ts +75 -0
- package/dist/src/pain/002/types.d.ts +73 -0
- package/dist/src/pain/002/utils.d.ts +4 -0
- package/dist/src/parseUtils.d.ts +21 -0
- package/dist/src/utils/format.d.ts +1 -0
- package/dist/test/camt/003/cash-management-get-account.test.d.ts +1 -0
- package/dist/test/camt/004/cash-management-return-account.test.d.ts +1 -0
- package/dist/test/camt/005/cash-management-get-transaction.test.d.ts +1 -0
- package/dist/test/camt/006/cash-management-return-transaction.test.d.ts +1 -0
- package/dist/test/camt/053/cash-management-end-of-day-report.test.d.ts +1 -0
- package/dist/test/pain/001/ach-credit-payment-initiation.test.d.ts +1 -0
- package/dist/test/pain/001/rtp-credit-payment-initiation.test.d.ts +1 -0
- package/dist/test/pain/001/sepa-credit-payment-initiation.test.d.ts +1 -0
- package/dist/test/pain/001/swift-credit-payment-initiation.test.d.ts +1 -0
- package/dist/test/pain/002/payment-status-report.test.d.ts +1 -0
- package/dist/test/parseUtils.test.d.ts +1 -0
- package/package.json +82 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1896 @@
|
|
|
1
|
+
import { Currency } from 'dinero.js';
|
|
2
|
+
import { XMLBuilder } from 'fast-xml-parser';
|
|
3
|
+
|
|
4
|
+
declare const Alpha2CountryCode: {
|
|
5
|
+
readonly AF: "AF";
|
|
6
|
+
readonly AL: "AL";
|
|
7
|
+
readonly DZ: "DZ";
|
|
8
|
+
readonly AS: "AS";
|
|
9
|
+
readonly AD: "AD";
|
|
10
|
+
readonly AO: "AO";
|
|
11
|
+
readonly AI: "AI";
|
|
12
|
+
readonly AQ: "AQ";
|
|
13
|
+
readonly AG: "AG";
|
|
14
|
+
readonly AR: "AR";
|
|
15
|
+
readonly AM: "AM";
|
|
16
|
+
readonly AW: "AW";
|
|
17
|
+
readonly AU: "AU";
|
|
18
|
+
readonly AT: "AT";
|
|
19
|
+
readonly AZ: "AZ";
|
|
20
|
+
readonly BS: "BS";
|
|
21
|
+
readonly BH: "BH";
|
|
22
|
+
readonly BD: "BD";
|
|
23
|
+
readonly BB: "BB";
|
|
24
|
+
readonly BY: "BY";
|
|
25
|
+
readonly BE: "BE";
|
|
26
|
+
readonly BZ: "BZ";
|
|
27
|
+
readonly BJ: "BJ";
|
|
28
|
+
readonly BM: "BM";
|
|
29
|
+
readonly BT: "BT";
|
|
30
|
+
readonly BO: "BO";
|
|
31
|
+
readonly BA: "BA";
|
|
32
|
+
readonly BW: "BW";
|
|
33
|
+
readonly BV: "BV";
|
|
34
|
+
readonly BR: "BR";
|
|
35
|
+
readonly IO: "IO";
|
|
36
|
+
readonly BN: "BN";
|
|
37
|
+
readonly BG: "BG";
|
|
38
|
+
readonly BF: "BF";
|
|
39
|
+
readonly BI: "BI";
|
|
40
|
+
readonly KH: "KH";
|
|
41
|
+
readonly CM: "CM";
|
|
42
|
+
readonly CA: "CA";
|
|
43
|
+
readonly CV: "CV";
|
|
44
|
+
readonly KY: "KY";
|
|
45
|
+
readonly CF: "CF";
|
|
46
|
+
readonly TD: "TD";
|
|
47
|
+
readonly CL: "CL";
|
|
48
|
+
readonly CN: "CN";
|
|
49
|
+
readonly CX: "CX";
|
|
50
|
+
readonly CC: "CC";
|
|
51
|
+
readonly CO: "CO";
|
|
52
|
+
readonly KM: "KM";
|
|
53
|
+
readonly CG: "CG";
|
|
54
|
+
readonly CD: "CD";
|
|
55
|
+
readonly CK: "CK";
|
|
56
|
+
readonly CR: "CR";
|
|
57
|
+
readonly CI: "CI";
|
|
58
|
+
readonly HR: "HR";
|
|
59
|
+
readonly CU: "CU";
|
|
60
|
+
readonly CY: "CY";
|
|
61
|
+
readonly CZ: "CZ";
|
|
62
|
+
readonly DK: "DK";
|
|
63
|
+
readonly DJ: "DJ";
|
|
64
|
+
readonly DM: "DM";
|
|
65
|
+
readonly DO: "DO";
|
|
66
|
+
readonly EC: "EC";
|
|
67
|
+
readonly EG: "EG";
|
|
68
|
+
readonly SV: "SV";
|
|
69
|
+
readonly GQ: "GQ";
|
|
70
|
+
readonly ER: "ER";
|
|
71
|
+
readonly EE: "EE";
|
|
72
|
+
readonly ET: "ET";
|
|
73
|
+
readonly FK: "FK";
|
|
74
|
+
readonly FO: "FO";
|
|
75
|
+
readonly FJ: "FJ";
|
|
76
|
+
readonly FI: "FI";
|
|
77
|
+
readonly FR: "FR";
|
|
78
|
+
readonly GF: "GF";
|
|
79
|
+
readonly PF: "PF";
|
|
80
|
+
readonly TF: "TF";
|
|
81
|
+
readonly GA: "GA";
|
|
82
|
+
readonly GM: "GM";
|
|
83
|
+
readonly GE: "GE";
|
|
84
|
+
readonly DE: "DE";
|
|
85
|
+
readonly GH: "GH";
|
|
86
|
+
readonly GI: "GI";
|
|
87
|
+
readonly GR: "GR";
|
|
88
|
+
readonly GL: "GL";
|
|
89
|
+
readonly GD: "GD";
|
|
90
|
+
readonly GP: "GP";
|
|
91
|
+
readonly GU: "GU";
|
|
92
|
+
readonly GT: "GT";
|
|
93
|
+
readonly GN: "GN";
|
|
94
|
+
readonly GW: "GW";
|
|
95
|
+
readonly GY: "GY";
|
|
96
|
+
readonly HT: "HT";
|
|
97
|
+
readonly HM: "HM";
|
|
98
|
+
readonly VA: "VA";
|
|
99
|
+
readonly HN: "HN";
|
|
100
|
+
readonly HK: "HK";
|
|
101
|
+
readonly HU: "HU";
|
|
102
|
+
readonly IS: "IS";
|
|
103
|
+
readonly IN: "IN";
|
|
104
|
+
readonly ID: "ID";
|
|
105
|
+
readonly IR: "IR";
|
|
106
|
+
readonly IQ: "IQ";
|
|
107
|
+
readonly IE: "IE";
|
|
108
|
+
readonly IL: "IL";
|
|
109
|
+
readonly IT: "IT";
|
|
110
|
+
readonly JM: "JM";
|
|
111
|
+
readonly JP: "JP";
|
|
112
|
+
readonly JO: "JO";
|
|
113
|
+
readonly KZ: "KZ";
|
|
114
|
+
readonly KE: "KE";
|
|
115
|
+
readonly KI: "KI";
|
|
116
|
+
readonly KP: "KP";
|
|
117
|
+
readonly KR: "KR";
|
|
118
|
+
readonly KW: "KW";
|
|
119
|
+
readonly KG: "KG";
|
|
120
|
+
readonly LA: "LA";
|
|
121
|
+
readonly LV: "LV";
|
|
122
|
+
readonly LB: "LB";
|
|
123
|
+
readonly LS: "LS";
|
|
124
|
+
readonly LR: "LR";
|
|
125
|
+
readonly LY: "LY";
|
|
126
|
+
readonly LI: "LI";
|
|
127
|
+
readonly LT: "LT";
|
|
128
|
+
readonly LU: "LU";
|
|
129
|
+
readonly MO: "MO";
|
|
130
|
+
readonly MG: "MG";
|
|
131
|
+
readonly MW: "MW";
|
|
132
|
+
readonly MY: "MY";
|
|
133
|
+
readonly MV: "MV";
|
|
134
|
+
readonly ML: "ML";
|
|
135
|
+
readonly MT: "MT";
|
|
136
|
+
readonly MH: "MH";
|
|
137
|
+
readonly MQ: "MQ";
|
|
138
|
+
readonly MR: "MR";
|
|
139
|
+
readonly MU: "MU";
|
|
140
|
+
readonly YT: "YT";
|
|
141
|
+
readonly MX: "MX";
|
|
142
|
+
readonly FM: "FM";
|
|
143
|
+
readonly MD: "MD";
|
|
144
|
+
readonly MC: "MC";
|
|
145
|
+
readonly MN: "MN";
|
|
146
|
+
readonly MS: "MS";
|
|
147
|
+
readonly MA: "MA";
|
|
148
|
+
readonly MZ: "MZ";
|
|
149
|
+
readonly MM: "MM";
|
|
150
|
+
readonly NA: "NA";
|
|
151
|
+
readonly NR: "NR";
|
|
152
|
+
readonly NP: "NP";
|
|
153
|
+
readonly NL: "NL";
|
|
154
|
+
readonly NC: "NC";
|
|
155
|
+
readonly NZ: "NZ";
|
|
156
|
+
readonly NI: "NI";
|
|
157
|
+
readonly NE: "NE";
|
|
158
|
+
readonly NG: "NG";
|
|
159
|
+
readonly NU: "NU";
|
|
160
|
+
readonly NF: "NF";
|
|
161
|
+
readonly MK: "MK";
|
|
162
|
+
readonly MP: "MP";
|
|
163
|
+
readonly NO: "NO";
|
|
164
|
+
readonly OM: "OM";
|
|
165
|
+
readonly PK: "PK";
|
|
166
|
+
readonly PW: "PW";
|
|
167
|
+
readonly PS: "PS";
|
|
168
|
+
readonly PA: "PA";
|
|
169
|
+
readonly PG: "PG";
|
|
170
|
+
readonly PY: "PY";
|
|
171
|
+
readonly PE: "PE";
|
|
172
|
+
readonly PH: "PH";
|
|
173
|
+
readonly PN: "PN";
|
|
174
|
+
readonly PL: "PL";
|
|
175
|
+
readonly PT: "PT";
|
|
176
|
+
readonly PR: "PR";
|
|
177
|
+
readonly QA: "QA";
|
|
178
|
+
readonly RE: "RE";
|
|
179
|
+
readonly RO: "RO";
|
|
180
|
+
readonly RU: "RU";
|
|
181
|
+
readonly RW: "RW";
|
|
182
|
+
readonly SH: "SH";
|
|
183
|
+
readonly KN: "KN";
|
|
184
|
+
readonly LC: "LC";
|
|
185
|
+
readonly PM: "PM";
|
|
186
|
+
readonly VC: "VC";
|
|
187
|
+
readonly WS: "WS";
|
|
188
|
+
readonly SM: "SM";
|
|
189
|
+
readonly ST: "ST";
|
|
190
|
+
readonly SA: "SA";
|
|
191
|
+
readonly SN: "SN";
|
|
192
|
+
readonly SC: "SC";
|
|
193
|
+
readonly SL: "SL";
|
|
194
|
+
readonly SG: "SG";
|
|
195
|
+
readonly SK: "SK";
|
|
196
|
+
readonly SI: "SI";
|
|
197
|
+
readonly SB: "SB";
|
|
198
|
+
readonly SO: "SO";
|
|
199
|
+
readonly ZA: "ZA";
|
|
200
|
+
readonly GS: "GS";
|
|
201
|
+
readonly ES: "ES";
|
|
202
|
+
readonly LK: "LK";
|
|
203
|
+
readonly SD: "SD";
|
|
204
|
+
readonly SR: "SR";
|
|
205
|
+
readonly SJ: "SJ";
|
|
206
|
+
readonly SZ: "SZ";
|
|
207
|
+
readonly SE: "SE";
|
|
208
|
+
readonly CH: "CH";
|
|
209
|
+
readonly SY: "SY";
|
|
210
|
+
readonly TW: "TW";
|
|
211
|
+
readonly TJ: "TJ";
|
|
212
|
+
readonly TZ: "TZ";
|
|
213
|
+
readonly TH: "TH";
|
|
214
|
+
readonly TL: "TL";
|
|
215
|
+
readonly TG: "TG";
|
|
216
|
+
readonly TK: "TK";
|
|
217
|
+
readonly TO: "TO";
|
|
218
|
+
readonly TT: "TT";
|
|
219
|
+
readonly TN: "TN";
|
|
220
|
+
readonly TR: "TR";
|
|
221
|
+
readonly TM: "TM";
|
|
222
|
+
readonly TC: "TC";
|
|
223
|
+
readonly TV: "TV";
|
|
224
|
+
readonly UG: "UG";
|
|
225
|
+
readonly UA: "UA";
|
|
226
|
+
readonly AE: "AE";
|
|
227
|
+
readonly GB: "GB";
|
|
228
|
+
readonly US: "US";
|
|
229
|
+
readonly UM: "UM";
|
|
230
|
+
readonly UY: "UY";
|
|
231
|
+
readonly UZ: "UZ";
|
|
232
|
+
readonly VU: "VU";
|
|
233
|
+
readonly VE: "VE";
|
|
234
|
+
readonly VN: "VN";
|
|
235
|
+
readonly VG: "VG";
|
|
236
|
+
readonly VI: "VI";
|
|
237
|
+
readonly WF: "WF";
|
|
238
|
+
readonly EH: "EH";
|
|
239
|
+
readonly YE: "YE";
|
|
240
|
+
readonly ZM: "ZM";
|
|
241
|
+
readonly ZW: "ZW";
|
|
242
|
+
readonly AX: "AX";
|
|
243
|
+
readonly BQ: "BQ";
|
|
244
|
+
readonly CW: "CW";
|
|
245
|
+
readonly GG: "GG";
|
|
246
|
+
readonly IM: "IM";
|
|
247
|
+
readonly JE: "JE";
|
|
248
|
+
readonly ME: "ME";
|
|
249
|
+
readonly BL: "BL";
|
|
250
|
+
readonly MF: "MF";
|
|
251
|
+
readonly RS: "RS";
|
|
252
|
+
readonly SX: "SX";
|
|
253
|
+
readonly SS: "SS";
|
|
254
|
+
readonly XK: "XK";
|
|
255
|
+
};
|
|
256
|
+
type Alpha2Country = (typeof Alpha2CountryCode)[keyof typeof Alpha2CountryCode];
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Represents a payment instruction with essential details.
|
|
260
|
+
*/
|
|
261
|
+
interface PaymentInstruction {
|
|
262
|
+
/** Unique identifier for the payment instruction. */
|
|
263
|
+
id?: string;
|
|
264
|
+
/** Unique end-to-end identifier for the payment. */
|
|
265
|
+
endToEndId?: string;
|
|
266
|
+
/** Indicates whether the payment is a credit or debit. */
|
|
267
|
+
direction?: 'credit' | 'debit';
|
|
268
|
+
/** The amount of the payment. Usually in cents. */
|
|
269
|
+
amount: number;
|
|
270
|
+
/** The currency of the payment. */
|
|
271
|
+
currency: Currency;
|
|
272
|
+
/** The party from which the payment is debited. */
|
|
273
|
+
debtor?: Party;
|
|
274
|
+
/** The party to which the payment is credited. */
|
|
275
|
+
creditor?: Party;
|
|
276
|
+
/** Additional information about the payment. */
|
|
277
|
+
remittanceInformation?: string;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Represents a credit payment instruction, extending the base PaymentInstruction.
|
|
281
|
+
*/
|
|
282
|
+
interface CreditPaymentInstruction extends PaymentInstruction {
|
|
283
|
+
direction?: 'credit';
|
|
284
|
+
creditor: Party;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Represents a SWIFT credit payment instruction, extending the base PaymentInstruction.
|
|
288
|
+
*/
|
|
289
|
+
interface SWIFTCreditPaymentInstruction extends CreditPaymentInstruction {
|
|
290
|
+
/** Specifies that this is a SWIFT payment. */
|
|
291
|
+
type?: 'swift';
|
|
292
|
+
}
|
|
293
|
+
interface SEPACreditPaymentInstruction extends CreditPaymentInstruction {
|
|
294
|
+
type?: 'sepa';
|
|
295
|
+
currency: 'EUR';
|
|
296
|
+
}
|
|
297
|
+
interface RTPCreditPaymentInstruction extends CreditPaymentInstruction {
|
|
298
|
+
type?: 'rtp';
|
|
299
|
+
currency: 'USD';
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Represents an ACH credit payment instruction, extending the base PaymentInstruction.
|
|
303
|
+
*/
|
|
304
|
+
interface ACHCreditPaymentInstruction extends CreditPaymentInstruction {
|
|
305
|
+
/** Specifies that this is an ACH payment. */
|
|
306
|
+
type?: 'ach';
|
|
307
|
+
/** ACH payments must use USD as currency. */
|
|
308
|
+
currency: 'USD';
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Category purpose codes as defined in ISO 20022 ExternalCategoryPurpose1Code.
|
|
312
|
+
* @see {@link https://www.iso20022.org/catalogue-messages/additional-content-messages/external-code-sets}
|
|
313
|
+
*/
|
|
314
|
+
declare const ExternalCategoryPurposeCode: {
|
|
315
|
+
/** Transaction is the payment of a bonus */
|
|
316
|
+
readonly Bonus: "BONU";
|
|
317
|
+
/** Transaction is a general cash management instruction */
|
|
318
|
+
readonly CashManagement: "CASH";
|
|
319
|
+
/** A service that is settling money for a bulk of card transactions */
|
|
320
|
+
readonly CardBulk: "CBLK";
|
|
321
|
+
/** Transaction is related to a payment of credit card */
|
|
322
|
+
readonly CreditCard: "CCRD";
|
|
323
|
+
/** Transaction is related to settlement of a trade */
|
|
324
|
+
readonly TradeSettlement: "CORT";
|
|
325
|
+
/** Transaction is related to a payment of debit card */
|
|
326
|
+
readonly DebitCard: "DCRD";
|
|
327
|
+
/** Transaction is the payment of dividends */
|
|
328
|
+
readonly Dividends: "DIVI";
|
|
329
|
+
/** Code used to pre-advise forthcoming deliver against payment instruction */
|
|
330
|
+
readonly DeliverAgainstPayment: "DVPM";
|
|
331
|
+
/** Transaction is related to ePayment */
|
|
332
|
+
readonly EPayment: "EPAY";
|
|
333
|
+
/** Transaction is related to the payment of a fee and interest */
|
|
334
|
+
readonly FeeAndInterest: "FCIN";
|
|
335
|
+
/** A service that is settling card transaction related fees between two parties */
|
|
336
|
+
readonly CardFeeSettlement: "FCOL";
|
|
337
|
+
/** General Person-to-Person Payment */
|
|
338
|
+
readonly GeneralP2P: "GP2P";
|
|
339
|
+
/** Transaction is a payment to or from a government department */
|
|
340
|
+
readonly Government: "GOVT";
|
|
341
|
+
/** Transaction is related to the payment of a hedging operation */
|
|
342
|
+
readonly Hedging: "HEDG";
|
|
343
|
+
/** Transaction is reimbursement of credit card payment */
|
|
344
|
+
readonly CreditCardReimbursement: "ICCP";
|
|
345
|
+
/** Transaction is reimbursement of debit card payment */
|
|
346
|
+
readonly DebitCardReimbursement: "IDCP";
|
|
347
|
+
/** Transaction is an intra-company payment */
|
|
348
|
+
readonly IntraCompany: "INTC";
|
|
349
|
+
/** Transaction is the payment of interest */
|
|
350
|
+
readonly Interest: "INTE";
|
|
351
|
+
/** Transaction is related to identify cash handling via Night Safe or Lockbox */
|
|
352
|
+
readonly Lockbox: "LBOX";
|
|
353
|
+
/** Transaction is related to the transfer of a loan to a borrower */
|
|
354
|
+
readonly Loan: "LOAN";
|
|
355
|
+
/** Mobile P2B Payment */
|
|
356
|
+
readonly MobileP2B: "MP2B";
|
|
357
|
+
/** Mobile P2P Payment */
|
|
358
|
+
readonly MobileP2P: "MP2P";
|
|
359
|
+
/** Other payment purpose */
|
|
360
|
+
readonly Other: "OTHR";
|
|
361
|
+
/** Transaction is the payment of pension */
|
|
362
|
+
readonly Pension: "PENS";
|
|
363
|
+
/** Collection used to re-present previously reversed or returned direct debit transactions */
|
|
364
|
+
readonly Represent: "RPRE";
|
|
365
|
+
/** Transaction is related to a reimbursement for commercial reasons */
|
|
366
|
+
readonly CommercialReimbursement: "RRCT";
|
|
367
|
+
/** Code used to pre-advise forthcoming receive against payment instruction */
|
|
368
|
+
readonly ReceiveAgainstPayment: "RVPM";
|
|
369
|
+
/** Transaction is the payment of salaries */
|
|
370
|
+
readonly Salary: "SALA";
|
|
371
|
+
/** Transaction is the payment of securities */
|
|
372
|
+
readonly Securities: "SECU";
|
|
373
|
+
/** Transaction is a social security benefit */
|
|
374
|
+
readonly SocialSecurityBenefit: "SSBE";
|
|
375
|
+
/** Transaction is related to a payment to a supplier */
|
|
376
|
+
readonly Supplier: "SUPP";
|
|
377
|
+
/** Transaction is the payment of taxes */
|
|
378
|
+
readonly Taxes: "TAXS";
|
|
379
|
+
/** Transaction is related to the payment of a trade finance transaction */
|
|
380
|
+
readonly Trade: "TRAD";
|
|
381
|
+
/** Transaction is related to treasury operations */
|
|
382
|
+
readonly Treasury: "TREA";
|
|
383
|
+
/** Transaction is the payment of value added tax */
|
|
384
|
+
readonly VAT: "VATX";
|
|
385
|
+
/** Transaction is the payment of withholding tax */
|
|
386
|
+
readonly WithholdingTax: "WHLD";
|
|
387
|
+
/** Transaction relates to a cash management sweep instruction */
|
|
388
|
+
readonly Sweep: "SWEP";
|
|
389
|
+
/** Transaction relates to a cash management top-up instruction */
|
|
390
|
+
readonly TopUp: "TOPG";
|
|
391
|
+
/** Transaction relates to a zero balance account instruction */
|
|
392
|
+
readonly ZeroBalance: "ZABA";
|
|
393
|
+
/** Transaction to be processed as a domestic payment instruction from foreign bank */
|
|
394
|
+
readonly DomesticFromForeign: "VOST";
|
|
395
|
+
/** Foreign Currency Transaction between domestic financial institutions */
|
|
396
|
+
readonly ForeignCurrencyDomestic: "FCDT";
|
|
397
|
+
/** Transaction is a direct debit for a cash order of notes and/or coins */
|
|
398
|
+
readonly CashOrder: "CIPC";
|
|
399
|
+
/** Transaction is a direct debit for a cash order of notes and/or coins */
|
|
400
|
+
readonly CashOrderConsolidated: "CONC";
|
|
401
|
+
/** Transaction is a payment for cash collection by Cash in Transit company */
|
|
402
|
+
readonly CashInTransit: "CGWV";
|
|
403
|
+
/** Transfer to/from savings or retirement account */
|
|
404
|
+
readonly Savings: "SAVG";
|
|
405
|
+
/** Cross border transaction subject to Dodd Frank 1073 */
|
|
406
|
+
readonly CrossBorderDoddFrank: "CTDF";
|
|
407
|
+
};
|
|
408
|
+
type ExternalCategoryPurpose = (typeof ExternalCategoryPurposeCode)[keyof typeof ExternalCategoryPurposeCode];
|
|
409
|
+
/**
|
|
410
|
+
* Represents a structured address format.
|
|
411
|
+
*/
|
|
412
|
+
interface StructuredAddress {
|
|
413
|
+
/** The name of the street. */
|
|
414
|
+
streetName?: string;
|
|
415
|
+
/** The building number on the street. */
|
|
416
|
+
buildingNumber?: string;
|
|
417
|
+
/** The name of the town or city. */
|
|
418
|
+
townName?: string;
|
|
419
|
+
/** The subdivision of the country (e.g., state, province). */
|
|
420
|
+
countrySubDivision?: string;
|
|
421
|
+
/** The postal or ZIP code. */
|
|
422
|
+
postalCode?: string;
|
|
423
|
+
/** The country, typically represented by a country code. */
|
|
424
|
+
country?: Alpha2Country;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Represents a party involved in a payment transaction.
|
|
428
|
+
*/
|
|
429
|
+
interface Party {
|
|
430
|
+
/** Unique identifier for the party. */
|
|
431
|
+
id?: string;
|
|
432
|
+
/** The name of the party. */
|
|
433
|
+
name?: string;
|
|
434
|
+
/** The structured address of the party. */
|
|
435
|
+
address?: StructuredAddress;
|
|
436
|
+
/** The account details of the party. */
|
|
437
|
+
account?: Account;
|
|
438
|
+
/** The financial agent (e.g., bank) of the party. */
|
|
439
|
+
agent?: Agent;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Represents an account identified by IBAN.
|
|
443
|
+
*/
|
|
444
|
+
interface IBANAccount {
|
|
445
|
+
/** The International Bank Account Number. */
|
|
446
|
+
iban: string;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Represents a basic account with account number and optional type.
|
|
450
|
+
*/
|
|
451
|
+
interface BaseAccount {
|
|
452
|
+
/** The account number. */
|
|
453
|
+
accountNumber: string;
|
|
454
|
+
/** The type of the account. */
|
|
455
|
+
accountType?: 'checking' | 'savings';
|
|
456
|
+
/** The currency of the account. */
|
|
457
|
+
currency?: Currency;
|
|
458
|
+
/** The name of the account. */
|
|
459
|
+
name?: string;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Represents either an IBAN account or a basic account.
|
|
463
|
+
*/
|
|
464
|
+
type Account = IBANAccount | BaseAccount;
|
|
465
|
+
/**
|
|
466
|
+
* Represents a financial agent identified by BIC.
|
|
467
|
+
*/
|
|
468
|
+
interface BICAgent {
|
|
469
|
+
/** The Bank Identifier Code. */
|
|
470
|
+
bic: string;
|
|
471
|
+
/** The structured address of the bank. */
|
|
472
|
+
bankAddress?: StructuredAddress;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Represents a financial agent identified by ABA routing number.
|
|
476
|
+
*/
|
|
477
|
+
interface ABAAgent {
|
|
478
|
+
/** The ABA routing number. */
|
|
479
|
+
abaRoutingNumber: string;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Represents either a BIC or ABA identified financial agent.
|
|
483
|
+
* NOTE: Sometimes an agent can include both a BIC and ABA routing number.
|
|
484
|
+
* This library does not support that yet, but we will need to.
|
|
485
|
+
*/
|
|
486
|
+
type Agent = BICAgent | ABAAgent;
|
|
487
|
+
/**
|
|
488
|
+
* ACH Local Instrument Codes as defined in NACHA standards.
|
|
489
|
+
* These codes identify the specific type of ACH transaction.
|
|
490
|
+
*/
|
|
491
|
+
declare const ACHLocalInstrumentCode: {
|
|
492
|
+
/** Corporate Credit or Debit */
|
|
493
|
+
readonly CorporateCreditDebit: "CCD";
|
|
494
|
+
/** Prearranged Payment and Deposit */
|
|
495
|
+
readonly PrearrangedPaymentDeposit: "PPD";
|
|
496
|
+
/** Internet-Initiated Entry */
|
|
497
|
+
readonly InternetInitiated: "WEB";
|
|
498
|
+
/** Telephone-Initiated Entry */
|
|
499
|
+
readonly TelephoneInitiated: "TEL";
|
|
500
|
+
/** Point-of-Purchase Entry */
|
|
501
|
+
readonly PointOfPurchase: "POP";
|
|
502
|
+
/** Accounts Receivable Entry */
|
|
503
|
+
readonly AccountsReceivable: "ARC";
|
|
504
|
+
/** Back Office Conversion */
|
|
505
|
+
readonly BackOfficeConversion: "BOC";
|
|
506
|
+
/** Represented Check Entry */
|
|
507
|
+
readonly RepresentedCheck: "RCK";
|
|
508
|
+
};
|
|
509
|
+
type ACHLocalInstrument = (typeof ACHLocalInstrumentCode)[keyof typeof ACHLocalInstrumentCode];
|
|
510
|
+
declare const ACHLocalInstrumentCodeDescriptionMap: {
|
|
511
|
+
readonly CCD: "Corporate Credit or Debit";
|
|
512
|
+
readonly PPD: "Prearranged Payment and Deposit";
|
|
513
|
+
readonly WEB: "Internet-Initiated Entry";
|
|
514
|
+
readonly TEL: "Telephone-Initiated Entry";
|
|
515
|
+
readonly POP: "Point-of-Purchase Entry";
|
|
516
|
+
readonly ARC: "Accounts Receivable Entry";
|
|
517
|
+
readonly BOC: "Back Office Conversion";
|
|
518
|
+
readonly RCK: "Represented Check Entry";
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Abstract base class for ISO20022 payment initiation (PAIN) messages.
|
|
523
|
+
* @abstract
|
|
524
|
+
*/
|
|
525
|
+
declare abstract class PaymentInitiation {
|
|
526
|
+
type: "swift" | "rtp" | "sepa" | "ach";
|
|
527
|
+
constructor({ type }: {
|
|
528
|
+
type: "swift" | "rtp" | "sepa" | "ach";
|
|
529
|
+
});
|
|
530
|
+
/**
|
|
531
|
+
* Serializes the payment initiation to a string format.
|
|
532
|
+
* @abstract
|
|
533
|
+
* @returns {string} The serialized payment initiation.
|
|
534
|
+
*/
|
|
535
|
+
abstract serialize(): string;
|
|
536
|
+
/**
|
|
537
|
+
* Formats a party's information according to ISO20022 standards.
|
|
538
|
+
* @param {Party} party - The party's information.
|
|
539
|
+
* @returns {Object} Formatted XML party information.
|
|
540
|
+
*/
|
|
541
|
+
party(party: Party): any;
|
|
542
|
+
/**
|
|
543
|
+
* Formats an account according to ISO20022 standards.
|
|
544
|
+
* This method handles both IBAN and non-IBAN accounts.
|
|
545
|
+
*
|
|
546
|
+
* @param {Account} account - The account to be formatted. Can be either an IBANAccount or a BaseAccount.
|
|
547
|
+
* @returns {Object} An object representing the formatted account information.
|
|
548
|
+
* For IBAN accounts, it returns an object with an IBAN identifier.
|
|
549
|
+
* For non-IBAN accounts, it returns an object with an 'Other' identifier.
|
|
550
|
+
*
|
|
551
|
+
* @example
|
|
552
|
+
* // For an IBAN account
|
|
553
|
+
* account({ iban: 'DE89370400440532013000' })
|
|
554
|
+
* // Returns: { Id: { IBAN: 'DE89370400440532013000' } }
|
|
555
|
+
*
|
|
556
|
+
* @example
|
|
557
|
+
* // For a non-IBAN account
|
|
558
|
+
* account({ accountNumber: '1234567890' })
|
|
559
|
+
* // Returns: { Id: { Othr: { Id: '1234567890' } } }
|
|
560
|
+
*/
|
|
561
|
+
account(account: Account): {
|
|
562
|
+
Id: {
|
|
563
|
+
IBAN: string;
|
|
564
|
+
};
|
|
565
|
+
} | {
|
|
566
|
+
Id: {
|
|
567
|
+
Othr: {
|
|
568
|
+
Id: string;
|
|
569
|
+
};
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
/**
|
|
573
|
+
* Formats an IBAN account according to ISO20022 standards.
|
|
574
|
+
* @param {IBANAccount} account - The IBAN account information.
|
|
575
|
+
* @returns {Object} Formatted XML IBAN account information.
|
|
576
|
+
*/
|
|
577
|
+
internationalAccount(account: IBANAccount): {
|
|
578
|
+
Id: {
|
|
579
|
+
IBAN: string;
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
/**
|
|
583
|
+
* Formats an agent according to ISO20022 standards.
|
|
584
|
+
* This method handles both BIC and ABA agents.
|
|
585
|
+
*
|
|
586
|
+
* @param {Agent} agent - The agent to be formatted. Can be either a BICAgent or an ABAAgent.
|
|
587
|
+
* @returns {Object} An object representing the formatted agent information.
|
|
588
|
+
* For BIC agents, it returns an object with a BIC identifier.
|
|
589
|
+
* For ABA agents, it returns an object with clearing system member identification.
|
|
590
|
+
*
|
|
591
|
+
* @example
|
|
592
|
+
* // For a BIC agent
|
|
593
|
+
* agent({ bic: 'BOFAUS3NXXX' })
|
|
594
|
+
* // Returns: { FinInstnId: { BIC: 'BOFAUS3NXXX' } }
|
|
595
|
+
*
|
|
596
|
+
* @example
|
|
597
|
+
* // For an ABA agent
|
|
598
|
+
* agent({ abaRoutingNumber: '026009593' })
|
|
599
|
+
* // Returns: { FinInstnId: { ClrSysMmbId: { MmbId: '026009593' } } }
|
|
600
|
+
*/
|
|
601
|
+
agent(agent: Agent): {
|
|
602
|
+
FinInstnId: {
|
|
603
|
+
BIC: string;
|
|
604
|
+
ClrSysMmbId?: undefined;
|
|
605
|
+
};
|
|
606
|
+
} | {
|
|
607
|
+
FinInstnId: {
|
|
608
|
+
ClrSysMmbId: {
|
|
609
|
+
ClrSysId: {
|
|
610
|
+
Cd: string;
|
|
611
|
+
};
|
|
612
|
+
MmbId: string;
|
|
613
|
+
};
|
|
614
|
+
BIC?: undefined;
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
/**
|
|
618
|
+
* Returns the string representation of the payment initiation.
|
|
619
|
+
* @returns {string} The serialized payment initiation.
|
|
620
|
+
*/
|
|
621
|
+
toString(): string;
|
|
622
|
+
static getBuilder(): XMLBuilder;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
type AtLeastOne$4<T> = [T, ...T[]];
|
|
626
|
+
/**
|
|
627
|
+
* Configuration for SWIFT Credit Payment Initiation.
|
|
628
|
+
*
|
|
629
|
+
* @property {Party} initiatingParty - The party initiating the payment.
|
|
630
|
+
* @property {AtLeastOne<SWIFTCreditPaymentInstruction>} paymentInstructions - An array of payment instructions.
|
|
631
|
+
* @property {string} [messageId] - Optional unique identifier for the message. If not provided, a UUID will be generated.
|
|
632
|
+
* @property {Date} [creationDate] - Optional creation date for the message. If not provided, current date will be used.
|
|
633
|
+
*/
|
|
634
|
+
interface SWIFTCreditPaymentInitiationConfig$1 {
|
|
635
|
+
/** The party initiating the payment. */
|
|
636
|
+
initiatingParty: Party;
|
|
637
|
+
/** An array of payment instructions. */
|
|
638
|
+
paymentInstructions: AtLeastOne$4<SWIFTCreditPaymentInstruction>;
|
|
639
|
+
/** Optional unique identifier for the message. If not provided, a UUID will be generated. */
|
|
640
|
+
messageId?: string;
|
|
641
|
+
/** Optional creation date for the message. If not provided, current date will be used. */
|
|
642
|
+
creationDate?: Date;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Represents a SWIFT Credit Payment v3 Initiation message (pain.001.001.03).
|
|
646
|
+
* @class
|
|
647
|
+
* @extends PaymentInitiation
|
|
648
|
+
* @param {SWIFTCreditPaymentInitiationConfig} config - The configuration for the SWIFT Credit Payment Initiation message.
|
|
649
|
+
* @example
|
|
650
|
+
* ```typescript
|
|
651
|
+
* // Creating a payment message
|
|
652
|
+
* const payment = new SWIFTCreditPaymentInitiation({
|
|
653
|
+
* ...
|
|
654
|
+
* });
|
|
655
|
+
* // Uploading to fiatwebservices.com
|
|
656
|
+
* client.paymentTransfers.create(payment);
|
|
657
|
+
* // Parsing from XML
|
|
658
|
+
* const xml = '<xml>...</xml>';
|
|
659
|
+
* const parsedTransfer = SWIFTCreditPaymentInitiation.fromXML(xml);
|
|
660
|
+
* ```
|
|
661
|
+
* @see {@link https://docs.iso20022js.com/pain/sepacredit} for more information.
|
|
662
|
+
*/
|
|
663
|
+
declare class SWIFTCreditPaymentInitiation extends PaymentInitiation {
|
|
664
|
+
initiatingParty: Party;
|
|
665
|
+
messageId: string;
|
|
666
|
+
creationDate: Date;
|
|
667
|
+
paymentInstructions: SWIFTCreditPaymentInstruction[];
|
|
668
|
+
paymentInformationId: string;
|
|
669
|
+
/**
|
|
670
|
+
* Creates an instance of SWIFTCreditPaymentInitiation.
|
|
671
|
+
* @param {SWIFTCreditPaymentInitiationConfig} config - The configuration object.
|
|
672
|
+
*/
|
|
673
|
+
constructor(config: SWIFTCreditPaymentInitiationConfig$1);
|
|
674
|
+
/**
|
|
675
|
+
* Validates the payment initiation data has the information required to create a valid XML file.
|
|
676
|
+
* @private
|
|
677
|
+
* @throws {Error} If messageId exceeds 35 characters.
|
|
678
|
+
* @throws {Error} If any creditor has incomplete address information.
|
|
679
|
+
*/
|
|
680
|
+
private validate;
|
|
681
|
+
/**
|
|
682
|
+
* Generates payment information for a single payment instruction.
|
|
683
|
+
* @param {SWIFTCreditPaymentInstruction} paymentInstruction - The payment instruction.
|
|
684
|
+
* @returns {Object} The credit transfer object.
|
|
685
|
+
*/
|
|
686
|
+
creditTransfer(paymentInstruction: SWIFTCreditPaymentInstruction): Record<string, any>;
|
|
687
|
+
/**
|
|
688
|
+
* Serializes the payment initiation to an XML string.
|
|
689
|
+
* @returns {string} The XML representation of the payment initiation.
|
|
690
|
+
*/
|
|
691
|
+
static fromXML(rawXml: string): SWIFTCreditPaymentInitiation;
|
|
692
|
+
serialize(): string;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
type AtLeastOne$3<T> = [T, ...T[]];
|
|
696
|
+
/**
|
|
697
|
+
* Configuration for SEPA Credit Payment Initiation.
|
|
698
|
+
*
|
|
699
|
+
* @property {Party} initiatingParty - The party initiating the SEPA credit transfer.
|
|
700
|
+
* @property {AtLeastOne<SEPACreditPaymentInstruction>} paymentInstructions - An array containing at least one payment instruction for SEPA credit transfer.
|
|
701
|
+
* @property {string} [messageId] - Optional unique identifier for the message. If not provided, a UUID will be generated.
|
|
702
|
+
* @property {Date} [creationDate] - Optional creation date for the message. If not provided, current date will be used.
|
|
703
|
+
* @property {ExternalCategoryPurpose} [categoryPurpose] - Optional category purpose code following ISO20022 ExternalCategoryPurpose1Code standard.
|
|
704
|
+
*/
|
|
705
|
+
interface SEPACreditPaymentInitiationConfig$1 {
|
|
706
|
+
/** The party initiating the SEPA credit transfer. */
|
|
707
|
+
initiatingParty: Party;
|
|
708
|
+
/** An array containing at least one payment instruction for SEPA credit transfer. */
|
|
709
|
+
paymentInstructions: AtLeastOne$3<SEPACreditPaymentInstruction>;
|
|
710
|
+
/** Optional unique identifier for the message. If not provided, a UUID will be generated. */
|
|
711
|
+
messageId?: string;
|
|
712
|
+
/** Optional creation date for the message. If not provided, current date will be used. */
|
|
713
|
+
creationDate?: Date;
|
|
714
|
+
/** Optional category purpose code following ISO20022 ExternalCategoryPurpose1Code standard */
|
|
715
|
+
categoryPurpose?: ExternalCategoryPurpose;
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Represents a SEPA Credit Payment Initiation.
|
|
719
|
+
* This class handles the creation and serialization of SEPA credit transfer messages
|
|
720
|
+
* according to the ISO20022 standard.
|
|
721
|
+
* @class
|
|
722
|
+
* @extends PaymentInitiation
|
|
723
|
+
* @param {SEPACreditPaymentInitiationConfig} config - The configuration for the SEPA Credit Payment Initiation message.
|
|
724
|
+
* @example
|
|
725
|
+
* ```typescript
|
|
726
|
+
* // Creating a SEPA payment message
|
|
727
|
+
* const payment = new SEPACreditPaymentInitiation({
|
|
728
|
+
* // configuration options
|
|
729
|
+
* });
|
|
730
|
+
* // Uploading the payment
|
|
731
|
+
* client.paymentTransfers.create(payment);
|
|
732
|
+
* // Parsing from XML
|
|
733
|
+
* const xml = '<xml>...</xml>';
|
|
734
|
+
* const parsedTransfer = SEPACreditPaymentInitiation.fromXML(xml);
|
|
735
|
+
* ```
|
|
736
|
+
* @see {@link https://docs.iso20022js.com/pain/sepacredit} for more information.
|
|
737
|
+
*/
|
|
738
|
+
declare class SEPACreditPaymentInitiation extends PaymentInitiation {
|
|
739
|
+
initiatingParty: Party;
|
|
740
|
+
messageId: string;
|
|
741
|
+
creationDate: Date;
|
|
742
|
+
paymentInstructions: AtLeastOne$3<SEPACreditPaymentInstruction>;
|
|
743
|
+
paymentInformationId: string;
|
|
744
|
+
categoryPurpose?: ExternalCategoryPurpose;
|
|
745
|
+
private formattedPaymentSum;
|
|
746
|
+
/**
|
|
747
|
+
* Creates an instance of SEPACreditPaymentInitiation.
|
|
748
|
+
* @param {SEPACreditPaymentInitiationConfig} config - The configuration object for the SEPA credit transfer.
|
|
749
|
+
*/
|
|
750
|
+
constructor(config: SEPACreditPaymentInitiationConfig$1);
|
|
751
|
+
/**
|
|
752
|
+
* Calculates the sum of all payment instructions.
|
|
753
|
+
* @private
|
|
754
|
+
* @param {AtLeastOne<SEPACreditPaymentInstruction>} instructions - Array of payment instructions.
|
|
755
|
+
* @returns {string} The total sum formatted as a string with 2 decimal places.
|
|
756
|
+
* @throws {Error} If payment instructions have different currencies.
|
|
757
|
+
*/
|
|
758
|
+
private sumPaymentInstructions;
|
|
759
|
+
/**
|
|
760
|
+
* Validates the payment initiation data according to SEPA requirements.
|
|
761
|
+
* @private
|
|
762
|
+
* @throws {Error} If messageId exceeds 35 characters.
|
|
763
|
+
* @throws {Error} If payment instructions have different currencies.
|
|
764
|
+
* @throws {Error} If any creditor has incomplete address information.
|
|
765
|
+
*/
|
|
766
|
+
private validate;
|
|
767
|
+
private validateAllInstructionsHaveSameCurrency;
|
|
768
|
+
/**
|
|
769
|
+
* Generates payment information for a single SEPA credit transfer instruction.
|
|
770
|
+
* @param {SEPACreditPaymentInstruction} instruction - The payment instruction.
|
|
771
|
+
* @returns {Object} The payment information object formatted according to SEPA specifications.
|
|
772
|
+
*/
|
|
773
|
+
creditTransfer(instruction: SEPACreditPaymentInstruction): {
|
|
774
|
+
Cdtr: any;
|
|
775
|
+
CdtrAcct: {
|
|
776
|
+
Id: {
|
|
777
|
+
IBAN: string;
|
|
778
|
+
};
|
|
779
|
+
Ccy: "EUR";
|
|
780
|
+
};
|
|
781
|
+
RmtInf: {
|
|
782
|
+
Ustrd: string;
|
|
783
|
+
} | undefined;
|
|
784
|
+
CdtrAgt?: {
|
|
785
|
+
FinInstnId: {
|
|
786
|
+
BIC: string;
|
|
787
|
+
ClrSysMmbId?: undefined;
|
|
788
|
+
};
|
|
789
|
+
} | {
|
|
790
|
+
FinInstnId: {
|
|
791
|
+
ClrSysMmbId: {
|
|
792
|
+
ClrSysId: {
|
|
793
|
+
Cd: string;
|
|
794
|
+
};
|
|
795
|
+
MmbId: string;
|
|
796
|
+
};
|
|
797
|
+
BIC?: undefined;
|
|
798
|
+
};
|
|
799
|
+
} | undefined;
|
|
800
|
+
PmtId: {
|
|
801
|
+
InstrId: string;
|
|
802
|
+
EndToEndId: string;
|
|
803
|
+
};
|
|
804
|
+
Amt: {
|
|
805
|
+
InstdAmt: {
|
|
806
|
+
'#': string;
|
|
807
|
+
'@Ccy': "EUR";
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
};
|
|
811
|
+
/**
|
|
812
|
+
* Serializes the SEPA credit transfer initiation to an XML string.
|
|
813
|
+
* @returns {string} The XML representation of the SEPA credit transfer initiation.
|
|
814
|
+
*/
|
|
815
|
+
serialize(): string;
|
|
816
|
+
static fromXML(rawXml: string): SEPACreditPaymentInitiation;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
type AtLeastOne$2<T> = [T, ...T[]];
|
|
820
|
+
/**
|
|
821
|
+
* Configuration for RTP Credit Payment Initiation.
|
|
822
|
+
*
|
|
823
|
+
* @property {Party} initiatingParty - The party initiating the RTP credit transfer.
|
|
824
|
+
* @property {AtLeastOne<RTPCreditPaymentInstruction>} paymentInstructions - Array containing at least one payment instruction for the RTP credit transfer.
|
|
825
|
+
* @property {string} [messageId] - Optional unique identifier for the message. If not provided, a UUID will be generated.
|
|
826
|
+
* @property {Date} [creationDate] - Optional creation date for the message. If not provided, current date will be used.
|
|
827
|
+
*/
|
|
828
|
+
interface RTPCreditPaymentInitiationConfig$1 {
|
|
829
|
+
/** The party initiating the RTP credit transfer. */
|
|
830
|
+
initiatingParty: Party;
|
|
831
|
+
/** Array containing at least one payment instruction for the RTP credit transfer. */
|
|
832
|
+
paymentInstructions: AtLeastOne$2<RTPCreditPaymentInstruction>;
|
|
833
|
+
/** Optional unique identifier for the message. If not provided, a UUID will be generated. */
|
|
834
|
+
messageId?: string;
|
|
835
|
+
/** Optional creation date for the message. If not provided, current date will be used. */
|
|
836
|
+
creationDate?: Date;
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Represents a RTP Credit Payment Initiation.
|
|
840
|
+
* This class handles the creation and serialization of RTP credit transfer messages
|
|
841
|
+
* according to the ISO20022 standard.
|
|
842
|
+
* @class
|
|
843
|
+
* @extends PaymentInitiation
|
|
844
|
+
* @param {RTPCreditPaymentInitiationConfig} config - The configuration for the RTP Credit Payment Initiation message.
|
|
845
|
+
* @example
|
|
846
|
+
* ```typescript
|
|
847
|
+
* // Creating a payment message
|
|
848
|
+
* const payment = new RTPCreditPaymentInitiation({
|
|
849
|
+
* ...
|
|
850
|
+
* });
|
|
851
|
+
* // Uploading to fiatwebservices.com
|
|
852
|
+
* client.paymentTransfers.create(payment);
|
|
853
|
+
* // Parsing from XML
|
|
854
|
+
* const xml = '<xml>...</xml>';
|
|
855
|
+
* const parsedTransfer = RTPCreditPaymentInitiation.fromXML(xml);
|
|
856
|
+
* ```
|
|
857
|
+
* @see {@link https://docs.iso20022js.com/pain/rtpcredit} for more information.
|
|
858
|
+
*/
|
|
859
|
+
declare class RTPCreditPaymentInitiation extends PaymentInitiation {
|
|
860
|
+
initiatingParty: Party;
|
|
861
|
+
paymentInstructions: AtLeastOne$2<RTPCreditPaymentInstruction>;
|
|
862
|
+
messageId: string;
|
|
863
|
+
creationDate: Date;
|
|
864
|
+
paymentInformationId: string;
|
|
865
|
+
private formattedPaymentSum;
|
|
866
|
+
constructor(config: RTPCreditPaymentInitiationConfig$1);
|
|
867
|
+
/**
|
|
868
|
+
* Calculates the sum of all payment instructions.
|
|
869
|
+
* @private
|
|
870
|
+
* @param {AtLeastOne<RTPCreditPaymentInstruction>} instructions - Array of payment instructions.
|
|
871
|
+
* @returns {string} The total sum formatted as a string with 2 decimal places.
|
|
872
|
+
* @throws {Error} If payment instructions have different currencies.
|
|
873
|
+
*/
|
|
874
|
+
private sumPaymentInstructions;
|
|
875
|
+
/**
|
|
876
|
+
* Validates the payment initiation data according to SEPA requirements.
|
|
877
|
+
* @private
|
|
878
|
+
* @throws {Error} If messageId exceeds 35 characters.
|
|
879
|
+
* @throws {Error} If payment instructions have different currencies.
|
|
880
|
+
* @throws {Error} If any creditor has incomplete address information.
|
|
881
|
+
*/
|
|
882
|
+
private validate;
|
|
883
|
+
/**
|
|
884
|
+
* Generates payment information for a single SEPA credit transfer instruction.
|
|
885
|
+
* @param {RTPCreditPaymentInstruction} instruction - The payment instruction.
|
|
886
|
+
* @returns {Object} The payment information object formatted according to SEPA specifications.
|
|
887
|
+
*/
|
|
888
|
+
creditTransfer(instruction: RTPCreditPaymentInstruction): {
|
|
889
|
+
PmtId: {
|
|
890
|
+
InstrId: string;
|
|
891
|
+
EndToEndId: string;
|
|
892
|
+
};
|
|
893
|
+
Amt: {
|
|
894
|
+
InstdAmt: {
|
|
895
|
+
'#': string;
|
|
896
|
+
'@Ccy': "USD";
|
|
897
|
+
};
|
|
898
|
+
};
|
|
899
|
+
CdtrAgt: {
|
|
900
|
+
FinInstnId: {
|
|
901
|
+
BIC: string;
|
|
902
|
+
ClrSysMmbId?: undefined;
|
|
903
|
+
};
|
|
904
|
+
} | {
|
|
905
|
+
FinInstnId: {
|
|
906
|
+
ClrSysMmbId: {
|
|
907
|
+
ClrSysId: {
|
|
908
|
+
Cd: string;
|
|
909
|
+
};
|
|
910
|
+
MmbId: string;
|
|
911
|
+
};
|
|
912
|
+
BIC?: undefined;
|
|
913
|
+
};
|
|
914
|
+
};
|
|
915
|
+
Cdtr: any;
|
|
916
|
+
CdtrAcct: {
|
|
917
|
+
Id: {
|
|
918
|
+
Othr: {
|
|
919
|
+
Id: string;
|
|
920
|
+
};
|
|
921
|
+
};
|
|
922
|
+
};
|
|
923
|
+
RmtInf: {
|
|
924
|
+
Ustrd: string;
|
|
925
|
+
} | undefined;
|
|
926
|
+
};
|
|
927
|
+
/**
|
|
928
|
+
* Serializes the RTP credit transfer initiation to an XML string.
|
|
929
|
+
* @returns {string} The XML representation of the RTP credit transfer initiation.
|
|
930
|
+
*/
|
|
931
|
+
serialize(): string;
|
|
932
|
+
static fromXML(rawXml: string): RTPCreditPaymentInitiation;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
type AtLeastOne$1<T> = [T, ...T[]];
|
|
936
|
+
/**
|
|
937
|
+
* Configuration for ACH Credit Payment Initiation.
|
|
938
|
+
*
|
|
939
|
+
* @property {Party} initiatingParty - The party initiating the ACH credit transfer.
|
|
940
|
+
* @property {AtLeastOne<ACHCreditPaymentInstruction>} paymentInstructions - Array containing at least one payment instruction for the ACH credit transfer.
|
|
941
|
+
* @property {string} [messageId] - Optional unique identifier for the message. If not provided, a UUID will be generated.
|
|
942
|
+
* @property {Date} [creationDate] - Optional creation date for the message. If not provided, current date will be used.
|
|
943
|
+
*/
|
|
944
|
+
interface ACHCreditPaymentInitiationConfig$1 {
|
|
945
|
+
/** The party initiating the ACH credit transfer. */
|
|
946
|
+
initiatingParty: Party;
|
|
947
|
+
/** Array containing at least one payment instruction for the ACH credit transfer. */
|
|
948
|
+
paymentInstructions: AtLeastOne$1<ACHCreditPaymentInstruction>;
|
|
949
|
+
/** Optional unique identifier for the message. If not provided, a UUID will be generated. */
|
|
950
|
+
messageId?: string;
|
|
951
|
+
/** Optional creation date for the message. If not provided, current date will be used. */
|
|
952
|
+
creationDate?: Date;
|
|
953
|
+
/** Optional local instrument code for the ACH credit transfer. If not provided, 'CCD' (Corporate Credit or Debit) will be used. */
|
|
954
|
+
localInstrument?: ACHLocalInstrument;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Represents an ACH Credit Payment Initiation.
|
|
958
|
+
* This class handles the creation and serialization of ACH credit transfer messages
|
|
959
|
+
* according to the ISO20022 standard.
|
|
960
|
+
* @class
|
|
961
|
+
* @extends PaymentInitiation
|
|
962
|
+
* @param {ACHCreditPaymentInitiationConfig} config - The configuration for the ACH Credit Payment Initiation message.
|
|
963
|
+
* @example
|
|
964
|
+
* ```typescript
|
|
965
|
+
* // Creating a payment message
|
|
966
|
+
* const payment = new ACHCreditPaymentInitiation({
|
|
967
|
+
* initiatingParty: {
|
|
968
|
+
* name: 'John Doe Corporation',
|
|
969
|
+
* id: 'JOHNDOE99',
|
|
970
|
+
* account: {
|
|
971
|
+
* accountNumber: '0123456789'
|
|
972
|
+
* },
|
|
973
|
+
* agent: {
|
|
974
|
+
* abaRoutingNumber: '123456789',
|
|
975
|
+
* }
|
|
976
|
+
* },
|
|
977
|
+
* paymentInstructions: [{
|
|
978
|
+
* type: 'ach',
|
|
979
|
+
* direction: 'credit',
|
|
980
|
+
* amount: 1000,
|
|
981
|
+
* currency: 'USD',
|
|
982
|
+
* creditor: {
|
|
983
|
+
* name: 'John Doe Funding LLC',
|
|
984
|
+
* account: {
|
|
985
|
+
* accountNumber: '0123456789'
|
|
986
|
+
* },
|
|
987
|
+
* agent: {
|
|
988
|
+
* abaRoutingNumber: '0123456789'
|
|
989
|
+
* }
|
|
990
|
+
* }
|
|
991
|
+
* }]
|
|
992
|
+
* });
|
|
993
|
+
*
|
|
994
|
+
* // Serializing to XML
|
|
995
|
+
* const xml = payment.serialize();
|
|
996
|
+
*
|
|
997
|
+
* // Parsing from XML
|
|
998
|
+
* const parsedPayment = ACHCreditPaymentInitiation.fromXML(xml);
|
|
999
|
+
* ```
|
|
1000
|
+
*/
|
|
1001
|
+
declare class ACHCreditPaymentInitiation extends PaymentInitiation {
|
|
1002
|
+
initiatingParty: Party;
|
|
1003
|
+
paymentInstructions: AtLeastOne$1<ACHCreditPaymentInstruction>;
|
|
1004
|
+
messageId: string;
|
|
1005
|
+
creationDate: Date;
|
|
1006
|
+
paymentInformationId: string;
|
|
1007
|
+
localInstrument: string;
|
|
1008
|
+
serviceLevel: string;
|
|
1009
|
+
instructionPriority: string;
|
|
1010
|
+
private formattedPaymentSum;
|
|
1011
|
+
constructor(config: ACHCreditPaymentInitiationConfig$1);
|
|
1012
|
+
/**
|
|
1013
|
+
* Calculates the sum of all payment instructions.
|
|
1014
|
+
* @private
|
|
1015
|
+
* @param {AtLeastOne<ACHCreditPaymentInstruction>} instructions - Array of payment instructions.
|
|
1016
|
+
* @returns {string} The total sum formatted as a string with 2 decimal places.
|
|
1017
|
+
* @throws {Error} If payment instructions have different currencies.
|
|
1018
|
+
*/
|
|
1019
|
+
private sumPaymentInstructions;
|
|
1020
|
+
/**
|
|
1021
|
+
* Validates the payment initiation data according to ACH requirements.
|
|
1022
|
+
* @private
|
|
1023
|
+
* @throws {Error} If messageId exceeds 35 characters.
|
|
1024
|
+
* @throws {Error} If payment instructions have different currencies.
|
|
1025
|
+
* @throws {Error} If any creditor has incomplete information.
|
|
1026
|
+
*/
|
|
1027
|
+
private validate;
|
|
1028
|
+
/**
|
|
1029
|
+
* Generates payment information for a single ACH credit transfer instruction.
|
|
1030
|
+
* @param {ACHCreditPaymentInstruction} instruction - The payment instruction.
|
|
1031
|
+
* @returns {Object} The payment information object formatted according to ACH specifications.
|
|
1032
|
+
*/
|
|
1033
|
+
creditTransfer(instruction: ACHCreditPaymentInstruction): {
|
|
1034
|
+
PmtId: {
|
|
1035
|
+
InstrId: string;
|
|
1036
|
+
EndToEndId: string;
|
|
1037
|
+
};
|
|
1038
|
+
Amt: {
|
|
1039
|
+
InstdAmt: {
|
|
1040
|
+
'#': string;
|
|
1041
|
+
'@Ccy': "USD";
|
|
1042
|
+
};
|
|
1043
|
+
};
|
|
1044
|
+
CdtrAgt: {
|
|
1045
|
+
FinInstnId: {
|
|
1046
|
+
BIC: string;
|
|
1047
|
+
ClrSysMmbId?: undefined;
|
|
1048
|
+
};
|
|
1049
|
+
} | {
|
|
1050
|
+
FinInstnId: {
|
|
1051
|
+
ClrSysMmbId: {
|
|
1052
|
+
ClrSysId: {
|
|
1053
|
+
Cd: string;
|
|
1054
|
+
};
|
|
1055
|
+
MmbId: string;
|
|
1056
|
+
};
|
|
1057
|
+
BIC?: undefined;
|
|
1058
|
+
};
|
|
1059
|
+
};
|
|
1060
|
+
Cdtr: any;
|
|
1061
|
+
CdtrAcct: {
|
|
1062
|
+
Id: {
|
|
1063
|
+
Othr: {
|
|
1064
|
+
Id: string;
|
|
1065
|
+
};
|
|
1066
|
+
};
|
|
1067
|
+
Tp: {
|
|
1068
|
+
Cd: string;
|
|
1069
|
+
};
|
|
1070
|
+
Ccy: "USD";
|
|
1071
|
+
};
|
|
1072
|
+
RmtInf: {
|
|
1073
|
+
Ustrd: string;
|
|
1074
|
+
} | undefined;
|
|
1075
|
+
};
|
|
1076
|
+
/**
|
|
1077
|
+
* Serializes the ACH credit transfer initiation to an XML string.
|
|
1078
|
+
* @returns {string} The XML representation of the ACH credit transfer initiation.
|
|
1079
|
+
*/
|
|
1080
|
+
serialize(): string;
|
|
1081
|
+
/**
|
|
1082
|
+
* Creates an ACHCreditPaymentInitiation instance from an XML string.
|
|
1083
|
+
* @param {string} rawXml - The XML string to parse.
|
|
1084
|
+
* @returns {ACHCreditPaymentInitiation} A new ACHCreditPaymentInitiation instance.
|
|
1085
|
+
* @throws {InvalidXmlError} If the XML format is invalid.
|
|
1086
|
+
* @throws {InvalidXmlNamespaceError} If the XML namespace is invalid.
|
|
1087
|
+
* @throws {Error} If multiple payment information blocks are found.
|
|
1088
|
+
*/
|
|
1089
|
+
static fromXML(rawXml: string): ACHCreditPaymentInitiation;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
type ISO20022MessageTypeName = `${string}.${string}`;
|
|
1093
|
+
interface GenericISO20022Message {
|
|
1094
|
+
/** serialize to XML string */
|
|
1095
|
+
serialize(): string;
|
|
1096
|
+
/** export to a json object that can then be serialized */
|
|
1097
|
+
toJSON(): any;
|
|
1098
|
+
readonly data: any;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* Represents a bank statement in the CAMT.053 format.
|
|
1103
|
+
*/
|
|
1104
|
+
interface Statement {
|
|
1105
|
+
/** Unique identifier for the statement. */
|
|
1106
|
+
id: string;
|
|
1107
|
+
/** Electronic sequence number of the statement. */
|
|
1108
|
+
electronicSequenceNumber?: number;
|
|
1109
|
+
/** Legal sequence number of the statement. */
|
|
1110
|
+
legalSequenceNumber?: number;
|
|
1111
|
+
/** Date and time when the statement was created. */
|
|
1112
|
+
creationDate: Date;
|
|
1113
|
+
/** Start date of the statement period. */
|
|
1114
|
+
fromDate?: Date;
|
|
1115
|
+
/** End date of the statement period. */
|
|
1116
|
+
toDate?: Date;
|
|
1117
|
+
/** Account details for which the statement is generated. */
|
|
1118
|
+
account: Account;
|
|
1119
|
+
/** Financial institution details. */
|
|
1120
|
+
agent: Agent;
|
|
1121
|
+
/** Total number of entries in the statement. */
|
|
1122
|
+
numOfEntries?: number;
|
|
1123
|
+
/** Sum of all entries in the statement. */
|
|
1124
|
+
sumOfEntries?: number;
|
|
1125
|
+
/** Net amount of all entries in the statement. */
|
|
1126
|
+
netAmountOfEntries?: number;
|
|
1127
|
+
/** Number of credit entries in the statement. */
|
|
1128
|
+
numOfCreditEntries?: number;
|
|
1129
|
+
/** Sum of all credit entries in the statement. */
|
|
1130
|
+
sumOfCreditEntries?: number;
|
|
1131
|
+
/** Number of debit entries in the statement. */
|
|
1132
|
+
numOfDebitEntries?: number;
|
|
1133
|
+
/** Sum of all debit entries in the statement. */
|
|
1134
|
+
sumOfDebitEntries?: number;
|
|
1135
|
+
/** Array of balance information. */
|
|
1136
|
+
balances: Balance[];
|
|
1137
|
+
/** Array of transaction entries. */
|
|
1138
|
+
entries: Entry[];
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* Represents a balance in the statement, delinated by date and type.
|
|
1142
|
+
*/
|
|
1143
|
+
interface Balance {
|
|
1144
|
+
/** Date of the balance. */
|
|
1145
|
+
date: Date;
|
|
1146
|
+
/** Type of the balance. */
|
|
1147
|
+
type: BalanceType;
|
|
1148
|
+
/** Amount of the balance. */
|
|
1149
|
+
amount: number;
|
|
1150
|
+
/** Indicates whether the balance is credit (positive) or debit (negative). */
|
|
1151
|
+
creditDebitIndicator: 'credit' | 'debit';
|
|
1152
|
+
/** Currency of the balance. */
|
|
1153
|
+
currency: Currency;
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* Represents a transaction entry in the statement.
|
|
1157
|
+
*/
|
|
1158
|
+
interface Entry {
|
|
1159
|
+
/** Unique reference ID for the entry, if included in the statement. */
|
|
1160
|
+
referenceId?: string;
|
|
1161
|
+
/** Indicates whether the entry is a credit or debit. */
|
|
1162
|
+
creditDebitIndicator: 'credit' | 'debit';
|
|
1163
|
+
/** Indicates if the entry is a reversal. */
|
|
1164
|
+
reversal: boolean;
|
|
1165
|
+
/** Date when the entry was booked. */
|
|
1166
|
+
bookingDate: Date;
|
|
1167
|
+
/** Amount of the entry. */
|
|
1168
|
+
amount: number;
|
|
1169
|
+
/** Currency of the entry. */
|
|
1170
|
+
currency: Currency;
|
|
1171
|
+
/** Proprietary code associated with the entry. */
|
|
1172
|
+
proprietaryCode: string;
|
|
1173
|
+
/** Array of individual transactions within this entry. */
|
|
1174
|
+
transactions: Transaction[];
|
|
1175
|
+
/** Additional entry information */
|
|
1176
|
+
additionalInformation?: string;
|
|
1177
|
+
/** Reference ID assigned by the account servicer. */
|
|
1178
|
+
accountServicerReferenceId?: string;
|
|
1179
|
+
/** Details about the type of transaction */
|
|
1180
|
+
bankTransactionCode: BankTransactionCode;
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* Represents an individual transaction within an entry.
|
|
1184
|
+
*/
|
|
1185
|
+
interface Transaction {
|
|
1186
|
+
/** Unique message ID for the transaction. */
|
|
1187
|
+
messageId?: string;
|
|
1188
|
+
/** Reference ID assigned by the account servicer. */
|
|
1189
|
+
accountServicerReferenceId?: string;
|
|
1190
|
+
/** ID of the payment information. */
|
|
1191
|
+
paymentInformationId?: string;
|
|
1192
|
+
/** Instruction ID for the transaction. */
|
|
1193
|
+
instructionId?: string;
|
|
1194
|
+
/** Unique transaction ID. */
|
|
1195
|
+
transactionId?: string;
|
|
1196
|
+
/** Instructed amount for the transaction. */
|
|
1197
|
+
instructedAmount?: number;
|
|
1198
|
+
/** Currency of the instructed amount. */
|
|
1199
|
+
instructedCurrency?: Currency;
|
|
1200
|
+
/** Proprietary purpose code for the transaction. */
|
|
1201
|
+
proprietaryPurpose?: string;
|
|
1202
|
+
/** Details of the debtor party. */
|
|
1203
|
+
debtor?: Party;
|
|
1204
|
+
/** Details of the creditor party. */
|
|
1205
|
+
creditor?: Party;
|
|
1206
|
+
/** Additional information about the remittance. */
|
|
1207
|
+
remittanceInformation?: string;
|
|
1208
|
+
/** Reason for return, if applicable. */
|
|
1209
|
+
returnReason?: string;
|
|
1210
|
+
/** Additional information about the return. */
|
|
1211
|
+
returnAdditionalInformation?: string;
|
|
1212
|
+
/** End-to-end ID for the entry. */
|
|
1213
|
+
endToEndId?: string;
|
|
1214
|
+
}
|
|
1215
|
+
interface BankTransactionCode {
|
|
1216
|
+
/** Specifies the business area of the underlying transaction. */
|
|
1217
|
+
domainCode?: string;
|
|
1218
|
+
/** Specifies the family within the domain of the underlying transaction. */
|
|
1219
|
+
domainFamilyCode?: string;
|
|
1220
|
+
/** Specifies the sub-product family within a specific family of the underlying transaction. */
|
|
1221
|
+
domainSubFamilyCode?: string;
|
|
1222
|
+
/** Bank transaction code in a proprietary form, as defined by the issuer. */
|
|
1223
|
+
proprietaryCode?: string;
|
|
1224
|
+
/** Identification of the issuer of the proprietary bank transaction code. */
|
|
1225
|
+
proprietaryCodeIssuer?: string;
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Balance types as defined in ISO 20022.
|
|
1229
|
+
* @see {@link https://www.iso20022.org/sites/default/files/2022-03/externalcodesets_4q2021_v2_1.xlsx}
|
|
1230
|
+
*/
|
|
1231
|
+
declare const BalanceTypeCode: {
|
|
1232
|
+
/** Closing balance of amount of money that is at the disposal of the account owner on the date specified. */
|
|
1233
|
+
readonly ClosingAvailable: "CLAV";
|
|
1234
|
+
/** Balance of the account at the end of the pre-agreed account reporting period. It is the sum of the opening booked balance at the beginning of the period and all entries booked to the account during the pre-agreed account reporting period. */
|
|
1235
|
+
readonly ClosingBooked: "CLBD";
|
|
1236
|
+
/** Forward available balance of money that is at the disposal of the account owner on the date specified. */
|
|
1237
|
+
readonly ForwardAvailable: "FWAV";
|
|
1238
|
+
/** Balance for informational purposes. */
|
|
1239
|
+
readonly Information: "INFO";
|
|
1240
|
+
/** Available balance calculated in the course of the account servicer's business day, at the time specified, and subject to further changes during the business day. The interim balance is calculated on the basis of booked credit and debit items during the calculation time/period specified. */
|
|
1241
|
+
readonly InterimAvailable: "ITAV";
|
|
1242
|
+
/** Balance calculated in the course of the account servicer's business day, at the time specified, and subject to further changes during the business day. The interim balance is calculated on the basis of booked credit and debit items during the calculation time/period specified. */
|
|
1243
|
+
readonly InterimBooked: "ITBD";
|
|
1244
|
+
/** Opening balance of amount of money that is at the disposal of the account owner on the date specified. */
|
|
1245
|
+
readonly OpeningAvailable: "OPAV";
|
|
1246
|
+
/** Book balance of the account at the beginning of the account reporting period. It always equals the closing book balance from the previous report. */
|
|
1247
|
+
readonly OpeningBooked: "OPBD";
|
|
1248
|
+
/** Balance of the account at the previously closed account reporting period. The opening booked balance for the new period has to be equal to this balance. Usage: the previously booked closing balance should equal (inclusive date) the booked closing balance of the date it references and equal the actual booked opening balance of the current date. */
|
|
1249
|
+
readonly PreviouslyClosedBooked: "PRCD";
|
|
1250
|
+
/** Balance, composed of booked entries and pending items known at the time of calculation, which projects the end of day balance if everything is booked on the account and no other entry is posted. */
|
|
1251
|
+
readonly Expected: "XPCD";
|
|
1252
|
+
/** The difference between the excess/(deficit) investable balance and the excess/(deficit) collected balance due to the reserve requirement. This balance is not used if the account's Earnings Credit Rate is net of reserves. This may be used when the earnings allowance rate is not adjusted for reserves. It may be that reserves have been subtracted from the collected balance to determine the investable balance. Therefore, they must be added back to the excess/(deficit) investable balance to determine the collected balance position. The presentation of this calculation is optional. AFP code=00 04 21 */
|
|
1253
|
+
readonly AdditionalBalReserveRequirement: "ABRR";
|
|
1254
|
+
};
|
|
1255
|
+
/**
|
|
1256
|
+
* Description mapping of BalanceTypeCode values to their names.
|
|
1257
|
+
*/
|
|
1258
|
+
declare const BalanceTypeCodeDescriptionMap: {
|
|
1259
|
+
readonly CLAV: "Closing Available";
|
|
1260
|
+
readonly CLBD: "Closing Booked";
|
|
1261
|
+
readonly FWAV: "Forward Available";
|
|
1262
|
+
readonly INFO: "Information";
|
|
1263
|
+
readonly ITAV: "Interim Available";
|
|
1264
|
+
readonly ITBD: "Interim Booked";
|
|
1265
|
+
readonly OPAV: "Opening Available";
|
|
1266
|
+
readonly OPBD: "Opening Booked";
|
|
1267
|
+
readonly PRCD: "Previously Closed Booked";
|
|
1268
|
+
readonly XPCD: "Expected";
|
|
1269
|
+
readonly ABRR: "Additional Balance Reserve Requirement";
|
|
1270
|
+
};
|
|
1271
|
+
type BalanceType = (typeof BalanceTypeCode)[keyof typeof BalanceTypeCode];
|
|
1272
|
+
|
|
1273
|
+
type AtLeastOne<T> = [T, ...T[]];
|
|
1274
|
+
/**
|
|
1275
|
+
* Configuration interface for the ISO20022 class.
|
|
1276
|
+
* @interface ISO20022Config
|
|
1277
|
+
* @example
|
|
1278
|
+
* const config: ISO20022Config = {
|
|
1279
|
+
* initiatingParty: {
|
|
1280
|
+
* name: 'Example Corp',
|
|
1281
|
+
* id: 'EXAMPLECORP',
|
|
1282
|
+
* account: {
|
|
1283
|
+
* accountNumber: '123456789',
|
|
1284
|
+
* },
|
|
1285
|
+
* agent: {
|
|
1286
|
+
* bic: 'CHASUS33',
|
|
1287
|
+
* bankAddress: {
|
|
1288
|
+
* country: 'US',
|
|
1289
|
+
* },
|
|
1290
|
+
* },
|
|
1291
|
+
* },
|
|
1292
|
+
* };
|
|
1293
|
+
*/
|
|
1294
|
+
interface ISO20022Config {
|
|
1295
|
+
/**
|
|
1296
|
+
* The party initiating the ISO20022 messages.
|
|
1297
|
+
* This party is typically the sender of the messages or the entity responsible for the transaction.
|
|
1298
|
+
* @type {Party}
|
|
1299
|
+
*/
|
|
1300
|
+
initiatingParty: Party;
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* Configuration interface for SWIFT Credit Payment Initiation.
|
|
1304
|
+
* @interface SWIFTCreditPaymentInitiationConfig
|
|
1305
|
+
* @example
|
|
1306
|
+
* const config: SWIFTCreditPaymentInitiationConfig = {
|
|
1307
|
+
* paymentInstructions: [
|
|
1308
|
+
* {
|
|
1309
|
+
* type: 'swift',
|
|
1310
|
+
* direction: 'credit',
|
|
1311
|
+
* amount: 1000,
|
|
1312
|
+
* currency: 'USD',
|
|
1313
|
+
* creditor: {
|
|
1314
|
+
* name: 'Hans Schneider',
|
|
1315
|
+
* account: {
|
|
1316
|
+
* iban: 'DE1234567890123456',
|
|
1317
|
+
* },
|
|
1318
|
+
* agent: {
|
|
1319
|
+
* bic: 'DEUTDEFF',
|
|
1320
|
+
* bankAddress: {
|
|
1321
|
+
* country: 'DE',
|
|
1322
|
+
* },
|
|
1323
|
+
* },
|
|
1324
|
+
* address: {
|
|
1325
|
+
* streetName: 'Hauptstraße',
|
|
1326
|
+
* buildingNumber: '42',
|
|
1327
|
+
* postalCode: '10115',
|
|
1328
|
+
* townName: 'Berlin',
|
|
1329
|
+
* country: 'DE',
|
|
1330
|
+
* },
|
|
1331
|
+
* },
|
|
1332
|
+
* remittanceInformation: 'Invoice payment #123',
|
|
1333
|
+
* },
|
|
1334
|
+
* ],
|
|
1335
|
+
* messageId: 'MSGID123', // Optional
|
|
1336
|
+
* creationDate: new Date(), // Optional
|
|
1337
|
+
* };
|
|
1338
|
+
*/
|
|
1339
|
+
interface SWIFTCreditPaymentInitiationConfig {
|
|
1340
|
+
/**
|
|
1341
|
+
* An array of payment instructions.
|
|
1342
|
+
* @type {AtLeastOne<SWIFTCreditPaymentInstruction>}
|
|
1343
|
+
*/
|
|
1344
|
+
paymentInstructions: AtLeastOne<SWIFTCreditPaymentInstruction>;
|
|
1345
|
+
/**
|
|
1346
|
+
* Optional unique identifier for the message. If not provided, a UUID will be generated.
|
|
1347
|
+
* @type {string}
|
|
1348
|
+
*/
|
|
1349
|
+
messageId?: string;
|
|
1350
|
+
/**
|
|
1351
|
+
* Optional creation date for the message. If not provided, current date will be used.
|
|
1352
|
+
* @type {Date}
|
|
1353
|
+
*/
|
|
1354
|
+
creationDate?: Date;
|
|
1355
|
+
}
|
|
1356
|
+
/**
|
|
1357
|
+
* Configuration interface for SEPA Credit Payment Initiation.
|
|
1358
|
+
* @interface SEPACreditPaymentInitiationConfig
|
|
1359
|
+
* @example
|
|
1360
|
+
* const config: SEPACreditPaymentInitiationConfig = {
|
|
1361
|
+
* paymentInstructions: [
|
|
1362
|
+
* {
|
|
1363
|
+
* type: 'sepa',
|
|
1364
|
+
* direction: 'credit',
|
|
1365
|
+
* amount: 1000, // €10.00 Euros
|
|
1366
|
+
* currency: 'EUR',
|
|
1367
|
+
* creditor: {
|
|
1368
|
+
* name: 'Hans Schneider',
|
|
1369
|
+
* account: {
|
|
1370
|
+
* iban: 'DE1234567890123456',
|
|
1371
|
+
* },
|
|
1372
|
+
* },
|
|
1373
|
+
* remittanceInformation: 'Invoice payment #123',
|
|
1374
|
+
* },
|
|
1375
|
+
* ],
|
|
1376
|
+
* messageId: 'MSGID123', // Optional
|
|
1377
|
+
* creationDate: new Date(), // Optional
|
|
1378
|
+
* };
|
|
1379
|
+
*/
|
|
1380
|
+
interface SEPACreditPaymentInitiationConfig {
|
|
1381
|
+
/**
|
|
1382
|
+
* An array of payment instructions.
|
|
1383
|
+
* @type {AtLeastOne<SEPACreditPaymentInstruction>}
|
|
1384
|
+
*/
|
|
1385
|
+
paymentInstructions: AtLeastOne<SEPACreditPaymentInstruction>;
|
|
1386
|
+
/**
|
|
1387
|
+
* Optional unique identifier for the message. If not provided, a UUID will be generated.
|
|
1388
|
+
* @type {string}
|
|
1389
|
+
*/
|
|
1390
|
+
messageId?: string;
|
|
1391
|
+
/**
|
|
1392
|
+
* Optional creation date for the message. If not provided, current date will be used.
|
|
1393
|
+
* @type {Date}
|
|
1394
|
+
*/
|
|
1395
|
+
creationDate?: Date;
|
|
1396
|
+
}
|
|
1397
|
+
/**
|
|
1398
|
+
* Configuration interface for RTP Credit Payment Initiation.
|
|
1399
|
+
* @interface RTPCreditPaymentInitiationConfig
|
|
1400
|
+
* @example
|
|
1401
|
+
* const config: RTPCreditPaymentInitiationConfig = {
|
|
1402
|
+
* paymentInstructions: [
|
|
1403
|
+
* {
|
|
1404
|
+
* type: 'rtp',
|
|
1405
|
+
* direction: 'credit',
|
|
1406
|
+
* amount: 100000, // $1000.00
|
|
1407
|
+
* currency: 'USD',
|
|
1408
|
+
* creditor: {
|
|
1409
|
+
* name: 'All-American Dogs Co.',
|
|
1410
|
+
* account: {
|
|
1411
|
+
* accountNumber: '123456789012',
|
|
1412
|
+
* },
|
|
1413
|
+
* agent: {
|
|
1414
|
+
* abaRoutingNumber: '37714568112',
|
|
1415
|
+
* },
|
|
1416
|
+
* },
|
|
1417
|
+
* remittanceInformation: '1000 Hot Dogs Feb26',
|
|
1418
|
+
* },
|
|
1419
|
+
* ],
|
|
1420
|
+
* messageId: 'MSGID123', // Optional
|
|
1421
|
+
* creationDate: new Date(), // Optional
|
|
1422
|
+
* };
|
|
1423
|
+
*/
|
|
1424
|
+
interface RTPCreditPaymentInitiationConfig {
|
|
1425
|
+
/**
|
|
1426
|
+
* An array of payment instructions.
|
|
1427
|
+
* @type {AtLeastOne<RTPCreditPaymentInstruction>}
|
|
1428
|
+
*/
|
|
1429
|
+
paymentInstructions: AtLeastOne<RTPCreditPaymentInstruction>;
|
|
1430
|
+
/**
|
|
1431
|
+
* Optional unique identifier for the message. If not provided, a UUID will be generated.
|
|
1432
|
+
* @type {string}
|
|
1433
|
+
*/
|
|
1434
|
+
messageId?: string;
|
|
1435
|
+
/**
|
|
1436
|
+
* Optional creation date for the message. If not provided, current date will be used.
|
|
1437
|
+
* @type {Date}
|
|
1438
|
+
*/
|
|
1439
|
+
creationDate?: Date;
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* Configuration interface for ACH Credit Payment Initiation.
|
|
1443
|
+
* @interface ACHCreditPaymentInitiationConfig
|
|
1444
|
+
* @example
|
|
1445
|
+
* const config: ACHCreditPaymentInitiationConfig = {
|
|
1446
|
+
* paymentInstructions: [
|
|
1447
|
+
* {
|
|
1448
|
+
* type: 'ach',
|
|
1449
|
+
* direction: 'credit',
|
|
1450
|
+
* amount: 100000, // $1000.00
|
|
1451
|
+
* currency: 'USD',
|
|
1452
|
+
* creditor: {
|
|
1453
|
+
* name: 'John Doe Funding LLC',
|
|
1454
|
+
* account: {
|
|
1455
|
+
* accountNumber: '123456789012',
|
|
1456
|
+
* },
|
|
1457
|
+
* agent: {
|
|
1458
|
+
* abaRoutingNumber: '123456789',
|
|
1459
|
+
* },
|
|
1460
|
+
* },
|
|
1461
|
+
* remittanceInformation: 'Invoice #12345',
|
|
1462
|
+
* },
|
|
1463
|
+
* ],
|
|
1464
|
+
* messageId: 'MSGID123', // Optional
|
|
1465
|
+
* creationDate: new Date(), // Optional
|
|
1466
|
+
* };
|
|
1467
|
+
*/
|
|
1468
|
+
interface ACHCreditPaymentInitiationConfig {
|
|
1469
|
+
/**
|
|
1470
|
+
* An array of payment instructions.
|
|
1471
|
+
* @type {AtLeastOne<ACHCreditPaymentInstruction>}
|
|
1472
|
+
*/
|
|
1473
|
+
paymentInstructions: AtLeastOne<ACHCreditPaymentInstruction>;
|
|
1474
|
+
/**
|
|
1475
|
+
* Optional unique identifier for the message. If not provided, a UUID will be generated.
|
|
1476
|
+
* @type {string}
|
|
1477
|
+
*/
|
|
1478
|
+
messageId?: string;
|
|
1479
|
+
/**
|
|
1480
|
+
* Optional creation date for the message. If not provided, current date will be used.
|
|
1481
|
+
* @type {Date}
|
|
1482
|
+
*/
|
|
1483
|
+
creationDate?: Date;
|
|
1484
|
+
}
|
|
1485
|
+
/**
|
|
1486
|
+
* Represents an ISO20022 core message creator.
|
|
1487
|
+
* This class provides methods to create various basic ISO20022 compliant messages.
|
|
1488
|
+
*
|
|
1489
|
+
* @example
|
|
1490
|
+
* const iso20022 = new ISO20022({
|
|
1491
|
+
* initiatingParty: {
|
|
1492
|
+
* name: 'Example Corp',
|
|
1493
|
+
* id: 'EXAMPLECORP',
|
|
1494
|
+
* account: {
|
|
1495
|
+
* accountNumber: '123456789',
|
|
1496
|
+
* },
|
|
1497
|
+
* agent: {
|
|
1498
|
+
* bic: 'CHASUS33',
|
|
1499
|
+
* bankAddress: {
|
|
1500
|
+
* country: 'US',
|
|
1501
|
+
* },
|
|
1502
|
+
* },
|
|
1503
|
+
* },
|
|
1504
|
+
* });
|
|
1505
|
+
*/
|
|
1506
|
+
declare class ISO20022 {
|
|
1507
|
+
private initiatingParty;
|
|
1508
|
+
/**
|
|
1509
|
+
* Creates an instance of ISO20022.
|
|
1510
|
+
* @param {ISO20022Config} config - The configuration object for ISO20022.
|
|
1511
|
+
*/
|
|
1512
|
+
constructor(config: ISO20022Config);
|
|
1513
|
+
/**
|
|
1514
|
+
* Creates a SWIFT Credit Payment Initiation message.
|
|
1515
|
+
* @param {SWIFTCreditPaymentInitiationConfig} config - Configuration containing payment instructions and optional parameters.
|
|
1516
|
+
* @example
|
|
1517
|
+
* const payment = iso20022.createSWIFTCreditPaymentInitiation({
|
|
1518
|
+
* paymentInstructions: [
|
|
1519
|
+
* {
|
|
1520
|
+
* type: 'swift',
|
|
1521
|
+
* direction: 'credit',
|
|
1522
|
+
* amount: 1000,
|
|
1523
|
+
* currency: 'USD',
|
|
1524
|
+
* creditor: {
|
|
1525
|
+
* name: 'Hans Schneider',
|
|
1526
|
+
* account: {
|
|
1527
|
+
* iban: 'DE1234567890123456',
|
|
1528
|
+
* },
|
|
1529
|
+
* agent: {
|
|
1530
|
+
* bic: 'DEUTDEFF',
|
|
1531
|
+
* bankAddress: {
|
|
1532
|
+
* country: 'DE',
|
|
1533
|
+
* },
|
|
1534
|
+
* },
|
|
1535
|
+
* address: {
|
|
1536
|
+
* streetName: 'Hauptstraße',
|
|
1537
|
+
* buildingNumber: '42',
|
|
1538
|
+
* postalCode: '10115',
|
|
1539
|
+
* townName: 'Berlin',
|
|
1540
|
+
* country: 'DE',
|
|
1541
|
+
* },
|
|
1542
|
+
* },
|
|
1543
|
+
* remittanceInformation: 'Invoice payment #123',
|
|
1544
|
+
* },
|
|
1545
|
+
* ],
|
|
1546
|
+
* messageId: 'SWIFT-MSG-001', // Optional
|
|
1547
|
+
* creationDate: new Date('2025-03-01'), // Optional
|
|
1548
|
+
* });
|
|
1549
|
+
* @returns {SWIFTCreditPaymentInitiation} A new SWIFT Credit Payment Initiation object.
|
|
1550
|
+
*/
|
|
1551
|
+
createSWIFTCreditPaymentInitiation(config: SWIFTCreditPaymentInitiationConfig): SWIFTCreditPaymentInitiation;
|
|
1552
|
+
/**
|
|
1553
|
+
* Creates a SEPA Credit Payment Initiation message.
|
|
1554
|
+
* @param {SEPACreditPaymentInitiationConfig} config - Configuration containing payment instructions and optional parameters.
|
|
1555
|
+
* @example
|
|
1556
|
+
* const payment = iso20022.createSEPACreditPaymentInitiation({
|
|
1557
|
+
* paymentInstructions: [
|
|
1558
|
+
* {
|
|
1559
|
+
* type: 'sepa',
|
|
1560
|
+
* direction: 'credit',
|
|
1561
|
+
* amount: 1000, // €10.00 Euros
|
|
1562
|
+
* currency: 'EUR',
|
|
1563
|
+
* creditor: {
|
|
1564
|
+
* name: 'Hans Schneider',
|
|
1565
|
+
* account: {
|
|
1566
|
+
* iban: 'DE1234567890123456',
|
|
1567
|
+
* },
|
|
1568
|
+
* },
|
|
1569
|
+
* remittanceInformation: 'Invoice payment #123',
|
|
1570
|
+
* },
|
|
1571
|
+
* ],
|
|
1572
|
+
* messageId: 'SEPA-MSG-001', // Optional
|
|
1573
|
+
* creationDate: new Date('2025-03-01'), // Optional
|
|
1574
|
+
* });
|
|
1575
|
+
* @returns {SEPACreditPaymentInitiation} A new SEPA Credit Payment Initiation object.
|
|
1576
|
+
*/
|
|
1577
|
+
createSEPACreditPaymentInitiation(config: SEPACreditPaymentInitiationConfig): SEPACreditPaymentInitiation;
|
|
1578
|
+
/**
|
|
1579
|
+
* Creates a RTP Credit Payment Initiation message.
|
|
1580
|
+
* @param {RTPCreditPaymentInitiationConfig} config - Configuration containing payment instructions and optional parameters.
|
|
1581
|
+
* @example
|
|
1582
|
+
* const payment = iso20022.createRTPCreditPaymentInitiation({
|
|
1583
|
+
* paymentInstructions: [
|
|
1584
|
+
* {
|
|
1585
|
+
* type: 'rtp',
|
|
1586
|
+
* direction: 'credit',
|
|
1587
|
+
* amount: 100000, // $1000.00
|
|
1588
|
+
* currency: 'USD',
|
|
1589
|
+
* creditor: {
|
|
1590
|
+
* name: 'All-American Dogs Co.',
|
|
1591
|
+
* account: {
|
|
1592
|
+
* accountNumber: '123456789012',
|
|
1593
|
+
* },
|
|
1594
|
+
* agent: {
|
|
1595
|
+
* abaRoutingNumber: '37714568112',
|
|
1596
|
+
* },
|
|
1597
|
+
* },
|
|
1598
|
+
* remittanceInformation: '1000 Hot Dogs Feb26',
|
|
1599
|
+
* },
|
|
1600
|
+
* ],
|
|
1601
|
+
* messageId: 'RTP-MSG-001', // Optional
|
|
1602
|
+
* creationDate: new Date('2025-03-01'), // Optional
|
|
1603
|
+
* });
|
|
1604
|
+
* @returns {RTPCreditPaymentInitiation} A new RTP Credit Payment Initiation object.
|
|
1605
|
+
*/
|
|
1606
|
+
createRTPCreditPaymentInitiation(config: RTPCreditPaymentInitiationConfig): RTPCreditPaymentInitiation;
|
|
1607
|
+
/**
|
|
1608
|
+
* Creates an ACH Credit Payment Initiation message.
|
|
1609
|
+
* @param {ACHCreditPaymentInitiationConfig} config - Configuration containing payment instructions and optional parameters.
|
|
1610
|
+
* @example
|
|
1611
|
+
* const payment = iso20022.createACHCreditPaymentInitiation({
|
|
1612
|
+
* paymentInstructions: [
|
|
1613
|
+
* {
|
|
1614
|
+
* type: 'ach',
|
|
1615
|
+
* direction: 'credit',
|
|
1616
|
+
* amount: 100000, // $1000.00
|
|
1617
|
+
* currency: 'USD',
|
|
1618
|
+
* creditor: {
|
|
1619
|
+
* name: 'John Doe Funding LLC',
|
|
1620
|
+
* account: {
|
|
1621
|
+
* accountNumber: '123456789012',
|
|
1622
|
+
* },
|
|
1623
|
+
* agent: {
|
|
1624
|
+
* abaRoutingNumber: '123456789',
|
|
1625
|
+
* },
|
|
1626
|
+
* },
|
|
1627
|
+
* remittanceInformation: 'Invoice #12345',
|
|
1628
|
+
* },
|
|
1629
|
+
* ],
|
|
1630
|
+
* messageId: 'ACH-MSG-001', // Optional
|
|
1631
|
+
* creationDate: new Date('2025-03-01'), // Optional
|
|
1632
|
+
* });
|
|
1633
|
+
* @returns {ACHCreditPaymentInitiation} A new ACH Credit Payment Initiation object.
|
|
1634
|
+
*/
|
|
1635
|
+
createACHCreditPaymentInitiation(config: ACHCreditPaymentInitiationConfig): ACHCreditPaymentInitiation;
|
|
1636
|
+
/** Create a message CAMT or other */
|
|
1637
|
+
createMessage(type: ISO20022MessageTypeName, config: any): GenericISO20022Message;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
/**
|
|
1641
|
+
* Represents the original group information in a payment status report.
|
|
1642
|
+
*/
|
|
1643
|
+
interface OriginalGroupInformation {
|
|
1644
|
+
/** The original message ID associated with the group. */
|
|
1645
|
+
originalMessageId: string;
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* Represents the type of status in a payment status report.
|
|
1649
|
+
*/
|
|
1650
|
+
type StatusType = 'group' | 'payment' | 'transaction';
|
|
1651
|
+
/**
|
|
1652
|
+
* Represents the status codes in a payment status report.
|
|
1653
|
+
* @see {@link https://www.iso20022.org/sites/default/files/2022-03/externalcodesets_4q2021_v2_1.xlsx}
|
|
1654
|
+
*/
|
|
1655
|
+
declare const PaymentStatusCode: {
|
|
1656
|
+
readonly Rejected: "RJCT";
|
|
1657
|
+
readonly PartiallyAccepted: "ACCP";
|
|
1658
|
+
readonly Pending: "PNDG";
|
|
1659
|
+
readonly Accepted: "ACCP";
|
|
1660
|
+
readonly AcceptedSettlementInProgress: "ACSP";
|
|
1661
|
+
readonly AcceptedCreditSettlementCompleted: "ACSC";
|
|
1662
|
+
readonly AcceptedSettlementCompleted: "ACSC";
|
|
1663
|
+
readonly AcceptedTechnicalValidation: "ACTC";
|
|
1664
|
+
};
|
|
1665
|
+
type PaymentStatus = (typeof PaymentStatusCode)[keyof typeof PaymentStatusCode];
|
|
1666
|
+
/**
|
|
1667
|
+
* Represents the base structure for status information in a payment status report.
|
|
1668
|
+
*/
|
|
1669
|
+
interface BaseStatusInformation {
|
|
1670
|
+
/** The type of status (group, payment, or transaction). */
|
|
1671
|
+
type: StatusType;
|
|
1672
|
+
/** The status value. */
|
|
1673
|
+
status: PaymentStatus;
|
|
1674
|
+
/** Optional reason for the status. */
|
|
1675
|
+
reason?: {
|
|
1676
|
+
/** Optional reason code. */
|
|
1677
|
+
code?: string;
|
|
1678
|
+
/** Optional additional information about the reason. */
|
|
1679
|
+
additionalInformation?: string;
|
|
1680
|
+
};
|
|
1681
|
+
}
|
|
1682
|
+
/**
|
|
1683
|
+
* Represents the status information for a group in a payment status report.
|
|
1684
|
+
*/
|
|
1685
|
+
interface GroupStatusInformation extends BaseStatusInformation {
|
|
1686
|
+
/** The type is always 'group' for GroupStatus. */
|
|
1687
|
+
type: 'group';
|
|
1688
|
+
/** The original message ID associated with the group. */
|
|
1689
|
+
originalMessageId: string;
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* Represents the status information for a payment in a payment status report.
|
|
1693
|
+
*/
|
|
1694
|
+
interface PaymentStatusInformation extends BaseStatusInformation {
|
|
1695
|
+
/** The type is always 'payment' for PaymentStatus. */
|
|
1696
|
+
type: 'payment';
|
|
1697
|
+
/** The original payment ID associated with the payment. */
|
|
1698
|
+
originalPaymentId: string;
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* Represents the status information for a transaction in a payment status report.
|
|
1702
|
+
*/
|
|
1703
|
+
interface TransactionStatusInformation extends BaseStatusInformation {
|
|
1704
|
+
/** The type is always 'transaction' for TransactionStatus. */
|
|
1705
|
+
type: 'transaction';
|
|
1706
|
+
/** The original end-to-end ID associated with the transaction. */
|
|
1707
|
+
originalEndToEndId: string;
|
|
1708
|
+
}
|
|
1709
|
+
/**
|
|
1710
|
+
* Represents the union type of all possible status information types in a payment status report.
|
|
1711
|
+
*/
|
|
1712
|
+
type StatusInformation = GroupStatusInformation | PaymentStatusInformation | TransactionStatusInformation;
|
|
1713
|
+
|
|
1714
|
+
/**
|
|
1715
|
+
* Configuration interface for creating a PaymentStatusReport instance.
|
|
1716
|
+
*/
|
|
1717
|
+
interface PaymentStatusReportConfig {
|
|
1718
|
+
/** Unique identifier for the message */
|
|
1719
|
+
messageId: string;
|
|
1720
|
+
creationDate: Date;
|
|
1721
|
+
initatingParty: Party;
|
|
1722
|
+
originalGroupInformation: OriginalGroupInformation;
|
|
1723
|
+
statusInformations: StatusInformation[];
|
|
1724
|
+
}
|
|
1725
|
+
/**
|
|
1726
|
+
* Represents a Payment Status Report, containing information about the status of payments and transactions.
|
|
1727
|
+
*/
|
|
1728
|
+
declare class PaymentStatusReport {
|
|
1729
|
+
private _messageId;
|
|
1730
|
+
private _creationDate;
|
|
1731
|
+
private _initatingParty;
|
|
1732
|
+
private _originalGroupInformation;
|
|
1733
|
+
private _statusInformations;
|
|
1734
|
+
/**
|
|
1735
|
+
* Creates a new PaymentStatusReport instance.
|
|
1736
|
+
* @param {PaymentStatusReportConfig} config - The configuration object for the PaymentStatusReport.
|
|
1737
|
+
*/
|
|
1738
|
+
constructor(config: PaymentStatusReportConfig);
|
|
1739
|
+
/**
|
|
1740
|
+
* Creates a PaymentStatusReport instance from an XML string.
|
|
1741
|
+
* @param {string} rawXml - The raw XML string to parse.
|
|
1742
|
+
* @returns {PaymentStatusReport} A new PaymentStatusReport instance.
|
|
1743
|
+
*/
|
|
1744
|
+
static fromXML(rawXml: string): PaymentStatusReport;
|
|
1745
|
+
/**
|
|
1746
|
+
* Gets the message ID of the Payment Status Report.
|
|
1747
|
+
* @returns {string} The message ID.
|
|
1748
|
+
*/
|
|
1749
|
+
get messageId(): string;
|
|
1750
|
+
/**
|
|
1751
|
+
* Gets the creation date of the Payment Status Report.
|
|
1752
|
+
* @returns {Date} The creation date.
|
|
1753
|
+
*/
|
|
1754
|
+
get creationDate(): Date;
|
|
1755
|
+
/**
|
|
1756
|
+
* Gets the initiating party of the Payment Status Report.
|
|
1757
|
+
* @returns {Party} The initiating party.
|
|
1758
|
+
*/
|
|
1759
|
+
get initatingParty(): Party;
|
|
1760
|
+
/**
|
|
1761
|
+
* Gets the original message ID from the original group information.
|
|
1762
|
+
* @returns {string} The original message ID.
|
|
1763
|
+
*/
|
|
1764
|
+
get originalMessageId(): string;
|
|
1765
|
+
/**
|
|
1766
|
+
* Gets all status information entries in the Payment Status Report.
|
|
1767
|
+
* @returns {StatusInformation[]} An array of StatusInformation objects.
|
|
1768
|
+
*/
|
|
1769
|
+
get statusInformations(): StatusInformation[];
|
|
1770
|
+
/**
|
|
1771
|
+
* Gets the first status information entry in the Payment Status Report.
|
|
1772
|
+
* @returns {StatusInformation} The first StatusInformation object in the statuses array.
|
|
1773
|
+
*/
|
|
1774
|
+
get firstStatusInformation(): StatusInformation;
|
|
1775
|
+
/**
|
|
1776
|
+
* Gets the original ID based on the type of the first status information.
|
|
1777
|
+
* @returns {string} The original ID, which could be the original message ID, payment ID, or end-to-end ID.
|
|
1778
|
+
*/
|
|
1779
|
+
get originalId(): string;
|
|
1780
|
+
/**
|
|
1781
|
+
* Gets the status from the first status information entry.
|
|
1782
|
+
* @returns {PaymentStatus} The Status from the first status information.
|
|
1783
|
+
*/
|
|
1784
|
+
get status(): PaymentStatus;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
/**
|
|
1788
|
+
* Configuration interface for creating a CashManagementEndOfDayReport instance.
|
|
1789
|
+
*/
|
|
1790
|
+
interface CashManagementEndOfDayReportConfig {
|
|
1791
|
+
/** Unique identifier for the message */
|
|
1792
|
+
messageId: string;
|
|
1793
|
+
/** Date and time when the report was created */
|
|
1794
|
+
creationDate: Date;
|
|
1795
|
+
/** Recipient (party without bank and institution) receiving the report */
|
|
1796
|
+
recipient?: {
|
|
1797
|
+
id?: string;
|
|
1798
|
+
name?: string;
|
|
1799
|
+
address?: StructuredAddress;
|
|
1800
|
+
};
|
|
1801
|
+
/** Array of bank statements included in the report */
|
|
1802
|
+
statements: Statement[];
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1805
|
+
* Represents a Cash Management End of Day Report (CAMT.053.x).
|
|
1806
|
+
* This class encapsulates the data and functionality related to processing
|
|
1807
|
+
* and accessing information from a CAMT.053 XML file.
|
|
1808
|
+
*/
|
|
1809
|
+
declare class CashManagementEndOfDayReport implements GenericISO20022Message {
|
|
1810
|
+
private _messageId;
|
|
1811
|
+
private _creationDate;
|
|
1812
|
+
private _recipient?;
|
|
1813
|
+
private _statements;
|
|
1814
|
+
constructor(config: CashManagementEndOfDayReportConfig);
|
|
1815
|
+
static supportedMessages(): ISO20022MessageTypeName[];
|
|
1816
|
+
get data(): CashManagementEndOfDayReportConfig;
|
|
1817
|
+
static fromDocumentObject(obj: {
|
|
1818
|
+
Document: any;
|
|
1819
|
+
}): CashManagementEndOfDayReport;
|
|
1820
|
+
/**
|
|
1821
|
+
* Creates a CashManagementEndOfDayReport instance from a raw XML string.
|
|
1822
|
+
*
|
|
1823
|
+
* @param {string} rawXml - The raw XML string containing the CAMT.053 data.
|
|
1824
|
+
* @returns {CashManagementEndOfDayReport} A new instance of CashManagementEndOfDayReport.
|
|
1825
|
+
* @throws {Error} If the XML parsing fails or required data is missing.
|
|
1826
|
+
*/
|
|
1827
|
+
static fromXML(rawXml: string): CashManagementEndOfDayReport;
|
|
1828
|
+
/**
|
|
1829
|
+
*
|
|
1830
|
+
* @param json - JSON string representing a CashManagementEndOfDayReport
|
|
1831
|
+
* @returns {CashManagementEndOfDayReport} A new instance of CashManagementEndOfDayReport
|
|
1832
|
+
* @throws {Error} If the JSON parsing fails or required data is missing.
|
|
1833
|
+
*/
|
|
1834
|
+
static fromJSON(json: string): CashManagementEndOfDayReport;
|
|
1835
|
+
toJSON(): any;
|
|
1836
|
+
serialize(): string;
|
|
1837
|
+
/**
|
|
1838
|
+
* Retrieves all balances from all statements in the report.
|
|
1839
|
+
* @returns {Balance[]} An array of all balances across all statements.
|
|
1840
|
+
*/
|
|
1841
|
+
get balances(): Balance[];
|
|
1842
|
+
/**
|
|
1843
|
+
* Retrieves all transactions from all statements in the report.
|
|
1844
|
+
* @returns {Transaction[]} An array of all transactions across all statements.
|
|
1845
|
+
*/
|
|
1846
|
+
get transactions(): Transaction[];
|
|
1847
|
+
/**
|
|
1848
|
+
* Retrieves all entries from all statements in the report.
|
|
1849
|
+
* @returns {Entry[]} An array of all entries across all statements.
|
|
1850
|
+
*/
|
|
1851
|
+
get entries(): Entry[];
|
|
1852
|
+
/**
|
|
1853
|
+
* Gets the unique identifier for the message.
|
|
1854
|
+
* @returns {string} The message ID.
|
|
1855
|
+
*/
|
|
1856
|
+
get messageId(): string;
|
|
1857
|
+
/**
|
|
1858
|
+
* Gets the party receiving the report.
|
|
1859
|
+
* @returns {Party | undefined} The recipient party information, or undefined if no recipient is set.
|
|
1860
|
+
*/
|
|
1861
|
+
get recipient(): Party | undefined;
|
|
1862
|
+
/**
|
|
1863
|
+
* Gets the date and time when the report was created.
|
|
1864
|
+
* @returns {Date} The creation date of the report.
|
|
1865
|
+
*/
|
|
1866
|
+
get creationDate(): Date;
|
|
1867
|
+
/**
|
|
1868
|
+
* Gets all statements included in the report.
|
|
1869
|
+
* @returns {Statement[]} An array of all statements in the report.
|
|
1870
|
+
*/
|
|
1871
|
+
get statements(): Statement[];
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* Base error class for all ISO 20022 related errors in the library.
|
|
1876
|
+
* Extends the native Error class with proper stack trace capture.
|
|
1877
|
+
*/
|
|
1878
|
+
declare class Iso20022JsError extends Error {
|
|
1879
|
+
constructor(message: string);
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* Error thrown when XML parsing or validation fails.
|
|
1883
|
+
* This error indicates that the provided XML is malformed or does not conform to expected structure.
|
|
1884
|
+
*/
|
|
1885
|
+
declare class InvalidXmlError extends Iso20022JsError {
|
|
1886
|
+
constructor(message: string);
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* Error thrown when XML namespace validation fails.
|
|
1890
|
+
* This error indicates that the XML document contains invalid or missing required ISO 20022 namespaces.
|
|
1891
|
+
*/
|
|
1892
|
+
declare class InvalidXmlNamespaceError extends Iso20022JsError {
|
|
1893
|
+
constructor(message: string);
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
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, 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 };
|