@develit-services/bank 6.1.1 → 6.1.3
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/base.cjs +2 -2
- package/dist/base.d.cts +2 -2
- package/dist/base.d.mts +2 -2
- package/dist/base.d.ts +2 -2
- package/dist/base.mjs +2 -2
- package/dist/database/schema.d.cts +1 -1
- package/dist/database/schema.d.mts +1 -1
- package/dist/database/schema.d.ts +1 -1
- package/dist/export/workflows.cjs +2 -2
- package/dist/export/workflows.mjs +2 -2
- package/dist/shared/{bank.kz-PKVi5.mjs → bank.B-y4t5NI.mjs} +77 -34
- package/dist/shared/{bank.D19D3a9C.d.mts → bank.BBNHHD0v.d.mts} +1 -1
- package/dist/shared/{bank.BWR4dqQ5.mjs → bank.BCO2CIVM.mjs} +1 -15
- package/dist/shared/{bank.-8YAJoxw.d.ts → bank.BO2rCT2t.d.ts} +1 -1
- package/dist/shared/{bank.CSmuzdUJ.cjs → bank.Bwe8T2eH.cjs} +1 -15
- package/dist/shared/{bank.CgiEbvJu.d.cts → bank.C7zoSV8F.d.cts} +2 -2
- package/dist/shared/{bank.CgiEbvJu.d.mts → bank.C7zoSV8F.d.mts} +2 -2
- package/dist/shared/{bank.CgiEbvJu.d.ts → bank.C7zoSV8F.d.ts} +2 -2
- package/dist/shared/{bank.DZyrkXc_.d.cts → bank.Dtw4Amqo.d.cts} +1 -1
- package/dist/shared/{bank.BsWBG0gb.cjs → bank.Dzl159tr.cjs} +77 -34
- package/dist/types.cjs +1 -1
- package/dist/types.d.cts +60 -14
- package/dist/types.d.mts +60 -14
- package/dist/types.d.ts +60 -14
- package/dist/types.mjs +1 -1
- package/package.json +1 -1
package/dist/base.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
-
const paymentDirection = require('./shared/bank.
|
|
4
|
+
const paymentDirection = require('./shared/bank.Dzl159tr.cjs');
|
|
5
5
|
const drizzleOrm = require('drizzle-orm');
|
|
6
6
|
const cloudflare_workers = require('cloudflare:workers');
|
|
7
7
|
const d1 = require('drizzle-orm/d1');
|
|
8
8
|
require('jose');
|
|
9
|
-
const bank = require('./shared/bank.
|
|
9
|
+
const bank = require('./shared/bank.Bwe8T2eH.cjs');
|
|
10
10
|
const zod = require('zod');
|
|
11
11
|
const database_schema = require('./shared/bank.Ca3jzmIb.cjs');
|
|
12
12
|
const generalCodes = require('@develit-io/general-codes');
|
package/dist/base.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.CgiEbvJu.cjs';
|
|
2
|
-
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.DZyrkXc_.cjs';
|
|
3
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
4
2
|
import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
+
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.C7zoSV8F.cjs';
|
|
4
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.Dtw4Amqo.cjs';
|
|
5
5
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
6
6
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
7
7
|
import { z } from 'zod';
|
package/dist/base.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.CgiEbvJu.mjs';
|
|
2
|
-
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.D19D3a9C.mjs';
|
|
3
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
4
2
|
import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
+
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.C7zoSV8F.mjs';
|
|
4
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.BBNHHD0v.mjs';
|
|
5
5
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
6
6
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
7
7
|
import { z } from 'zod';
|
package/dist/base.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.CgiEbvJu.js';
|
|
2
|
-
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.-8YAJoxw.js';
|
|
3
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
4
2
|
import { WorkflowInstanceStatus, IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
+
import { B as BatchSelectType, P as PaymentRequestSelectType, A as AccountSelectType, a as PaymentSelectType, L as LastSyncMetadata, C as ConnectorConfig, t as tables, b as ConnectorKey, c as ConfigEnvironmentBank, I as IBankConnector, d as PaymentType, e as CurrencyCode, H as HandleAuthorizationCallbackInput, f as HandleAuthorizationCallbackOutput } from './shared/bank.C7zoSV8F.js';
|
|
4
|
+
import { S as SendPaymentInput, a as SendPaymentOutput, b as SendPaymentSyncInput, c as SendPaymentSyncOutput, F as FinbricksSupportedBanksResponse } from './shared/bank.BO2rCT2t.js';
|
|
5
5
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
6
6
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
7
7
|
import { z } from 'zod';
|
package/dist/base.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { uuidv4, first, buildMultiFilterConditions as buildMultiFilterConditions$1, bankAccountMetadataSchema, structuredAddressSchema, workflowInstanceStatusSchema, develitWorker, createInternalError, action, service } from '@develit-io/backend-sdk';
|
|
2
|
-
import { G as tables, g as accountInsertSchema, H as relations, o as isProcessedStatus, p as isTerminalStatus, L as getNonTerminalPaymentRequestsQuery, x as toIncomingPayment, N as calculateCzechIban, j as assignAccount, u as toBatchedPayment, y as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from './shared/bank.
|
|
2
|
+
import { G as tables, g as accountInsertSchema, H as relations, o as isProcessedStatus, p as isTerminalStatus, L as getNonTerminalPaymentRequestsQuery, x as toIncomingPayment, N as calculateCzechIban, j as assignAccount, u as toBatchedPayment, y as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from './shared/bank.B-y4t5NI.mjs';
|
|
3
3
|
import { eq, sql, and, like, asc, desc, inArray, gte, lte, isNull, count } from 'drizzle-orm';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { drizzle } from 'drizzle-orm/d1';
|
|
6
6
|
import 'jose';
|
|
7
|
-
import { h as encrypt, d as createCredentialsResolver, i as initiateConnector, e as updatePaymentRequestStatusCommand, a as getPaymentRequestsByBatchIdQuery, g as getBatchByIdQuery, u as upsertBatchCommand, j as importAesKey, f as createPaymentCommand, b as getAccountByIdQuery } from './shared/bank.
|
|
7
|
+
import { h as encrypt, d as createCredentialsResolver, i as initiateConnector, e as updatePaymentRequestStatusCommand, a as getPaymentRequestsByBatchIdQuery, g as getBatchByIdQuery, u as upsertBatchCommand, j as importAesKey, f as createPaymentCommand, b as getAccountByIdQuery } from './shared/bank.BCO2CIVM.mjs';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { I as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, g as PAYMENT_TYPES, b as CONNECTOR_KEYS, a as BATCH_STATUSES, f as PAYMENT_STATUSES, P as PAYMENT_DIRECTIONS, e as PAYMENT_REQUEST_STATUSES } from './shared/bank.BT7HayCV.mjs';
|
|
10
10
|
import { CURRENCY_CODES } from '@develit-io/general-codes';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.C7zoSV8F.cjs';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
3
|
import 'drizzle-orm';
|
|
4
4
|
import '@develit-io/general-codes';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.C7zoSV8F.mjs';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
3
|
import 'drizzle-orm';
|
|
4
4
|
import '@develit-io/general-codes';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aB as account, aC as accountCredentials, aD as batch, aE as ott, aF as payment, aG as paymentRequest } from '../shared/bank.C7zoSV8F.js';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
3
|
import 'drizzle-orm';
|
|
4
4
|
import '@develit-io/general-codes';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
-
const paymentDirection = require('../shared/bank.
|
|
4
|
+
const paymentDirection = require('../shared/bank.Dzl159tr.cjs');
|
|
5
5
|
const batchLifecycle = require('../shared/bank.NF8bZBy0.cjs');
|
|
6
6
|
const drizzleOrm = require('drizzle-orm');
|
|
7
|
-
const bank = require('../shared/bank.
|
|
7
|
+
const bank = require('../shared/bank.Bwe8T2eH.cjs');
|
|
8
8
|
const cloudflare_workers = require('cloudflare:workers');
|
|
9
9
|
const cloudflare_workflows = require('cloudflare:workflows');
|
|
10
10
|
const d1 = require('drizzle-orm/d1');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { first, uuidv4, asNonEmpty } from '@develit-io/backend-sdk';
|
|
2
|
-
import { G as tables, H as relations, v as toBatchedPaymentFromPaymentRequest, z as toPreparedPayment, m as isPaymentCompleted } from '../shared/bank.
|
|
2
|
+
import { G as tables, H as relations, v as toBatchedPaymentFromPaymentRequest, z as toPreparedPayment, m as isPaymentCompleted } from '../shared/bank.B-y4t5NI.mjs';
|
|
3
3
|
import { i as isBatchAuthorized, b as isBatchFailed, d as isBatchProcessing } from '../shared/bank.XqSw509X.mjs';
|
|
4
4
|
import { sql, and, eq, inArray } from 'drizzle-orm';
|
|
5
|
-
import { g as getBatchByIdQuery, a as getPaymentRequestsByBatchIdQuery, c as checksum, u as upsertBatchCommand, b as getAccountByIdQuery, d as createCredentialsResolver, i as initiateConnector, e as updatePaymentRequestStatusCommand, f as createPaymentCommand } from '../shared/bank.
|
|
5
|
+
import { g as getBatchByIdQuery, a as getPaymentRequestsByBatchIdQuery, c as checksum, u as upsertBatchCommand, b as getAccountByIdQuery, d as createCredentialsResolver, i as initiateConnector, e as updatePaymentRequestStatusCommand, f as createPaymentCommand } from '../shared/bank.BCO2CIVM.mjs';
|
|
6
6
|
import { WorkflowEntrypoint } from 'cloudflare:workers';
|
|
7
7
|
import { NonRetryableError } from 'cloudflare:workflows';
|
|
8
8
|
import { drizzle } from 'drizzle-orm/d1';
|
|
@@ -910,6 +910,23 @@ class FinbricksConnector extends IBankConnector {
|
|
|
910
910
|
supportsPaymentType(paymentType) {
|
|
911
911
|
return paymentType === "DOMESTIC" || paymentType === "SEPA" || paymentType === "SWIFT";
|
|
912
912
|
}
|
|
913
|
+
/**
|
|
914
|
+
* ČSOB mandates the UDT and we are an obliged entity, so a missing one must
|
|
915
|
+
* fail the payment — buildUltimateCreditor used to drop it silently instead.
|
|
916
|
+
*/
|
|
917
|
+
assertUltimateCreditor(creditor, options) {
|
|
918
|
+
if (this.PROVIDER !== "CSOB") return;
|
|
919
|
+
if (buildUltimateCreditor(creditor, options)) return;
|
|
920
|
+
const missing = [
|
|
921
|
+
!creditor.holderName && "holder name",
|
|
922
|
+
!(creditor.address?.streetName ?? creditor.address?.buildingNumber) && "street address"
|
|
923
|
+
].filter(Boolean);
|
|
924
|
+
throw createInternalError(null, {
|
|
925
|
+
status: 422,
|
|
926
|
+
code: "VALID-B-019",
|
|
927
|
+
message: `\u010CSOB requires the recipient (UDT) in the payment's free-text field, but the creditor${creditor.holderName ? ` "${creditor.holderName}"` : ""} is missing its ${missing.join(" and ")}. Complete the counterparty data and retry.`
|
|
928
|
+
});
|
|
929
|
+
}
|
|
913
930
|
async getClientId(accountId) {
|
|
914
931
|
if (!this.resolveCredentials) {
|
|
915
932
|
throw createInternalError(null, {
|
|
@@ -1092,6 +1109,11 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1092
1109
|
message: `Batch for unauthorized client with iban: ${payments[0].debtor.iban}`
|
|
1093
1110
|
});
|
|
1094
1111
|
await this.getClientId(authorizedClient.id);
|
|
1112
|
+
for (const p of payments) {
|
|
1113
|
+
this.assertUltimateCreditor(p.creditor, {
|
|
1114
|
+
stripDiacritics: p.currency !== "CZK"
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1095
1117
|
const [response, error] = await useResult(
|
|
1096
1118
|
this.finbricks.request({
|
|
1097
1119
|
endpoint: FINBRICKS_ENDPOINTS.TRANSACTION_BATCH_INIT,
|
|
@@ -1139,15 +1161,6 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1139
1161
|
initiateForeignBatchImpl(_args) {
|
|
1140
1162
|
throw new Error("Finbricks: Foreign batch not implemented");
|
|
1141
1163
|
}
|
|
1142
|
-
/**
|
|
1143
|
-
* endToEndIdentification for the SEPA rail. Optional per the Finbricks spec —
|
|
1144
|
-
* return `undefined` to omit the field entirely, which some executing banks
|
|
1145
|
-
* need because they overwrite the remittance text with it (see
|
|
1146
|
-
* `CreditasConnector`).
|
|
1147
|
-
*/
|
|
1148
|
-
buildSepaEndToEndId(payment) {
|
|
1149
|
-
return this.buildEndToEndId(payment);
|
|
1150
|
-
}
|
|
1151
1164
|
async initiateForeignPayment(payment) {
|
|
1152
1165
|
const debtorAccount = this.connectedAccounts.find(
|
|
1153
1166
|
(acc) => acc.iban === payment.debtorIban
|
|
@@ -1170,6 +1183,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1170
1183
|
ks: payment.ks
|
|
1171
1184
|
});
|
|
1172
1185
|
const remittanceBase = [reference, payment.message?.trim()].filter(Boolean).join(" ") || void 0;
|
|
1186
|
+
this.assertUltimateCreditor(payment.creditor, {
|
|
1187
|
+
stripDiacritics: payment.currency !== "CZK"
|
|
1188
|
+
});
|
|
1173
1189
|
const unstructured = this.PROVIDER === "CSOB" ? composeWithUltimateCreditor(remittanceBase, payment.creditor, {
|
|
1174
1190
|
stripDiacritics: payment.currency !== "CZK"
|
|
1175
1191
|
}) : remittanceBase?.slice(0, 140) || void 0;
|
|
@@ -1245,9 +1261,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1245
1261
|
ss: payment.ss,
|
|
1246
1262
|
ks: payment.ks
|
|
1247
1263
|
});
|
|
1248
|
-
const
|
|
1249
|
-
|
|
1250
|
-
|
|
1264
|
+
const udtOptions = { stripDiacritics: payment.currency !== "CZK" };
|
|
1265
|
+
this.assertUltimateCreditor(payment.creditor, udtOptions);
|
|
1266
|
+
const udt = this.PROVIDER === "CSOB" ? buildUltimateCreditor(payment.creditor, udtOptions) : void 0;
|
|
1251
1267
|
const reserved = (reference ? reference.length + 1 : 0) + (udt ? udt.length + 2 : 0);
|
|
1252
1268
|
const base = [message.slice(0, Math.max(0, 140 - reserved)), reference].filter(Boolean).join(" ");
|
|
1253
1269
|
const combined = udt ? base ? `${base}, ${udt}` : udt : base;
|
|
@@ -1255,10 +1271,6 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1255
1271
|
0,
|
|
1256
1272
|
140
|
|
1257
1273
|
);
|
|
1258
|
-
const endToEndIdentification = this.buildSepaEndToEndId({
|
|
1259
|
-
...payment,
|
|
1260
|
-
id: payment.id
|
|
1261
|
-
});
|
|
1262
1274
|
const bankRefId = uuidv4();
|
|
1263
1275
|
const [response, error] = await useResult(
|
|
1264
1276
|
this.finbricks.request({
|
|
@@ -1272,7 +1284,10 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1272
1284
|
},
|
|
1273
1285
|
paymentIdentification: {
|
|
1274
1286
|
merchantTransactionId: bankRefId,
|
|
1275
|
-
|
|
1287
|
+
endToEndIdentification: this.buildEndToEndId({
|
|
1288
|
+
...payment,
|
|
1289
|
+
id: payment.id
|
|
1290
|
+
})
|
|
1276
1291
|
},
|
|
1277
1292
|
amount: payment.amount,
|
|
1278
1293
|
debtor: {
|
|
@@ -1317,29 +1332,57 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1317
1332
|
(acc) => acc.iban === payment.debtor.iban
|
|
1318
1333
|
);
|
|
1319
1334
|
await this.getClientId(debtorAccount.id);
|
|
1335
|
+
const debtorIban = resolveCzechDomesticIban(payment.debtor);
|
|
1336
|
+
const creditorIban = resolveCzechDomesticIban(payment.creditor);
|
|
1337
|
+
if (!creditorIban || !payment.creditor.holderName) {
|
|
1338
|
+
throw createInternalError(null, {
|
|
1339
|
+
status: 422,
|
|
1340
|
+
code: "VALID-B-018",
|
|
1341
|
+
message: `Domestic payment needs the creditor's ${!creditorIban ? "IBAN (or account number + bank code)" : "name"}.`
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
const udtOptions = { stripDiacritics: false };
|
|
1345
|
+
this.assertUltimateCreditor(payment.creditor, udtOptions);
|
|
1346
|
+
const composed = this.PROVIDER === "CSOB" ? composeWithUltimateCreditor(
|
|
1347
|
+
payment.message,
|
|
1348
|
+
payment.creditor,
|
|
1349
|
+
udtOptions
|
|
1350
|
+
) : payment.message?.trim() || void 0;
|
|
1351
|
+
const unstructured = this.PROVIDER === "CSOB" && (composed?.length ?? 0) < 3 ? "Platba" : composed;
|
|
1320
1352
|
const [response, error] = await useResult(
|
|
1321
1353
|
this.finbricks.request({
|
|
1322
1354
|
endpoint: FINBRICKS_ENDPOINTS.TRANSACTION_INIT,
|
|
1323
1355
|
method: "POST",
|
|
1324
1356
|
body: {
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1357
|
+
merchantIdentification: {
|
|
1358
|
+
merchantId: this.finbricks.MERCHANT_ID
|
|
1359
|
+
// TEMP: clientId disabled per client request — do not send.
|
|
1360
|
+
// clientId,
|
|
1361
|
+
},
|
|
1362
|
+
paymentIdentification: {
|
|
1363
|
+
merchantTransactionId: payment.id,
|
|
1364
|
+
czechSymbols: {
|
|
1365
|
+
variableSymbol: payment.vs ?? (payment.ss ? void 0 : autoVariableSymbol(payment.id)),
|
|
1366
|
+
specificSymbol: payment.ss ?? void 0,
|
|
1367
|
+
constantSymbol: payment.ks ?? void 0
|
|
1368
|
+
}
|
|
1369
|
+
},
|
|
1370
|
+
amount: {
|
|
1371
|
+
value: payment.amount,
|
|
1372
|
+
currency: payment.currency ?? "CZK"
|
|
1373
|
+
},
|
|
1374
|
+
debtor: {
|
|
1375
|
+
...debtorIban && {
|
|
1376
|
+
accountIdentification: { value: debtorIban, type: "IBAN" }
|
|
1377
|
+
},
|
|
1378
|
+
paymentProvider: this.PROVIDER
|
|
1379
|
+
},
|
|
1380
|
+
creditor: {
|
|
1381
|
+
accountIdentification: { value: creditorIban, type: "IBAN" },
|
|
1382
|
+
creditorName: payment.creditor.holderName.slice(0, 100)
|
|
1383
|
+
},
|
|
1384
|
+
...unstructured && { remittanceInformation: { unstructured } },
|
|
1339
1385
|
callbackUrl: `${this.finbricks.REDIRECT_URI}?type=paymentRequest&paymentRequestId=${payment.id}`,
|
|
1340
|
-
// TEMP: clientId disabled per client request — do not send.
|
|
1341
|
-
// clientId,
|
|
1342
|
-
paymentProvider: this.PROVIDER,
|
|
1343
1386
|
instructionPriority: toFinbricksPriority(payment.instructionPriority)
|
|
1344
1387
|
}
|
|
1345
1388
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as CurrencyCode,
|
|
1
|
+
import { e as CurrencyCode, R as BankCode, a1 as CountryCode, P as PaymentRequestSelectType } from './bank.C7zoSV8F.mjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sql, and, eq, isNull } from 'drizzle-orm';
|
|
2
|
-
import { G as tables, b as FinbricksConnector, J as buildEndToEndId, c as MockConnector, D as DbuConnector, C as CsobConnector, K as KBConnector, M as MockCobsConnector, E as ErsteConnector } from './bank.
|
|
2
|
+
import { G as tables, b as FinbricksConnector, J as buildEndToEndId, c as MockConnector, D as DbuConnector, C as CsobConnector, K as KBConnector, M as MockCobsConnector, E as ErsteConnector } from './bank.B-y4t5NI.mjs';
|
|
3
3
|
import { uuidv4 } from '@develit-io/backend-sdk';
|
|
4
4
|
import './bank.BT7HayCV.mjs';
|
|
5
5
|
import 'date-fns';
|
|
@@ -165,20 +165,6 @@ class CreditasConnector extends FinbricksConnector {
|
|
|
165
165
|
supportsBatch() {
|
|
166
166
|
return false;
|
|
167
167
|
}
|
|
168
|
-
/**
|
|
169
|
-
* Creditas discards `remittanceInformation.unstructured` on outgoing SEPA and
|
|
170
|
-
* puts `endToEndIdentification` on the recipient's statement instead, so the
|
|
171
|
-
* payer's message never arrives. Omitting E2E (optional per the Finbricks
|
|
172
|
-
* spec) leaves the remittance as the only reference carrier.
|
|
173
|
-
*
|
|
174
|
-
* Evidenced by control payment 2026-07-27 (mtid
|
|
175
|
-
* 76c75147-b25b-4581-a088-31aa394877f8, build 5.7.0): sent remittance
|
|
176
|
-
* "interní převod DB VS2607277272" + E2E "/VS2607277272", statement showed
|
|
177
|
-
* "/VS2607277272" — the leading slash only ever existed in E2E.
|
|
178
|
-
*/
|
|
179
|
-
buildSepaEndToEndId() {
|
|
180
|
-
return void 0;
|
|
181
|
-
}
|
|
182
168
|
}
|
|
183
169
|
|
|
184
170
|
class CSASConnector extends FinbricksConnector {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as CurrencyCode,
|
|
1
|
+
import { e as CurrencyCode, R as BankCode, a1 as CountryCode, P as PaymentRequestSelectType } from './bank.C7zoSV8F.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const drizzleOrm = require('drizzle-orm');
|
|
4
|
-
const paymentDirection = require('./bank.
|
|
4
|
+
const paymentDirection = require('./bank.Dzl159tr.cjs');
|
|
5
5
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
6
6
|
require('./bank.Ca3jzmIb.cjs');
|
|
7
7
|
require('date-fns');
|
|
@@ -167,20 +167,6 @@ class CreditasConnector extends paymentDirection.FinbricksConnector {
|
|
|
167
167
|
supportsBatch() {
|
|
168
168
|
return false;
|
|
169
169
|
}
|
|
170
|
-
/**
|
|
171
|
-
* Creditas discards `remittanceInformation.unstructured` on outgoing SEPA and
|
|
172
|
-
* puts `endToEndIdentification` on the recipient's statement instead, so the
|
|
173
|
-
* payer's message never arrives. Omitting E2E (optional per the Finbricks
|
|
174
|
-
* spec) leaves the remittance as the only reference carrier.
|
|
175
|
-
*
|
|
176
|
-
* Evidenced by control payment 2026-07-27 (mtid
|
|
177
|
-
* 76c75147-b25b-4581-a088-31aa394877f8, build 5.7.0): sent remittance
|
|
178
|
-
* "interní převod DB VS2607277272" + E2E "/VS2607277272", statement showed
|
|
179
|
-
* "/VS2607277272" — the leading slash only ever existed in E2E.
|
|
180
|
-
*/
|
|
181
|
-
buildSepaEndToEndId() {
|
|
182
|
-
return void 0;
|
|
183
|
-
}
|
|
184
170
|
}
|
|
185
171
|
|
|
186
172
|
class CSASConnector extends paymentDirection.FinbricksConnector {
|
|
@@ -5457,5 +5457,5 @@ type ParsedBankPayment = {
|
|
|
5457
5457
|
*/
|
|
5458
5458
|
type BatchPayment = Omit<PaymentInsertType, 'bankRefId'>;
|
|
5459
5459
|
|
|
5460
|
-
export {
|
|
5461
|
-
export type { AccountSelectType as A, BatchSelectType as B, ConnectorConfig as C, AccountCredentialsSelectType as D,
|
|
5460
|
+
export { IBankConnector as I, BASE_TERMINAL_STATUSES as M, BATCH_MODES as N, BATCH_STATUSES as O, CHARGE_BEARERS as X, CONNECTOR_KEYS as Y, COUNTRY_CODES as Z, CREDENTIALS_TYPES as _, INSTRUCTION_PRIORITIES as a3, PAYMENT_DIRECTIONS as a5, PAYMENT_REQUEST_STATUSES as a6, PAYMENT_STATUSES as a7, PAYMENT_TYPES as a8, isTerminalStatus as aA, account as aB, accountCredentials as aC, batch as aD, ott as aE, payment as aF, paymentRequest as aG, TOKEN_TYPES as ai, accountCredentialsInsertSchema as ak, accountCredentialsSelectSchema as al, accountCredentialsUpdateSchema as am, accountInsertSchema as an, accountSelectSchema as ao, accountUpdateSchema as ap, hasPaymentAccountAssigned as aq, isBatchAuthorized as ar, isBatchCompleted as as, isBatchFailed as at, isBatchInitiated as au, isBatchProcessing as av, isBatchReadyToSign as aw, isPaymentCompleted as ax, isPendingStatus as ay, isProcessedStatus as az, tables as t, ACCOUNT_STATUSES as y };
|
|
5461
|
+
export type { ChargeBearer as $, AccountSelectType as A, BatchSelectType as B, ConnectorConfig as C, AccountCredentialsSelectType as D, AccountCredentialsUpdateType as E, AccountPatchType as F, AccountStatus as G, HandleAuthorizationCallbackInput as H, AccountUpdateType as J, AuthorizedBatch as K, LastSyncMetadata as L, PaymentRequestSelectType as P, BankAccountWithLastSync as Q, BankCode as R, BatchInsertType as S, BatchLifecycle as T, BatchMode as U, BatchPayment as V, BatchStatus as W, PaymentSelectType as a, CompletedBatch as a0, CountryCode as a1, CredentialsType as a2, InstructionPriority as a4, PaymentDirection as a9, PaymentFailedInsertType as aa, PaymentInsertType as ab, PaymentLifecycle as ac, PaymentPreparedInsertType as ad, PaymentStatus as ae, ProcessingBatch as af, ReadyToSignBatch as ag, ResolvedCredentials as ah, TokenType as aj, ConnectorKey as b, ConfigEnvironmentBank as c, PaymentType as d, CurrencyCode as e, HandleAuthorizationCallbackOutput as f, ConnectedAccount as g, CredentialsResolver as h, AccountCredentialsInsertType as i, AccountInsertType as j, BatchedPayment as k, InitiatedBatch as l, IncomingPayment as m, InitiatedPayment as n, ParsedBankPayment as o, PaymentRequestStatus as p, AuthorizationCallbackResult as q, BatchMetadata as r, Currency as s, AccountAssignedPayment as u, PreparedPayment as v, CompletedPayment as w, PaymentRequestInsertType as x, AccountCredentialsPatchType as z };
|
|
@@ -5457,5 +5457,5 @@ type ParsedBankPayment = {
|
|
|
5457
5457
|
*/
|
|
5458
5458
|
type BatchPayment = Omit<PaymentInsertType, 'bankRefId'>;
|
|
5459
5459
|
|
|
5460
|
-
export {
|
|
5461
|
-
export type { AccountSelectType as A, BatchSelectType as B, ConnectorConfig as C, AccountCredentialsSelectType as D,
|
|
5460
|
+
export { IBankConnector as I, BASE_TERMINAL_STATUSES as M, BATCH_MODES as N, BATCH_STATUSES as O, CHARGE_BEARERS as X, CONNECTOR_KEYS as Y, COUNTRY_CODES as Z, CREDENTIALS_TYPES as _, INSTRUCTION_PRIORITIES as a3, PAYMENT_DIRECTIONS as a5, PAYMENT_REQUEST_STATUSES as a6, PAYMENT_STATUSES as a7, PAYMENT_TYPES as a8, isTerminalStatus as aA, account as aB, accountCredentials as aC, batch as aD, ott as aE, payment as aF, paymentRequest as aG, TOKEN_TYPES as ai, accountCredentialsInsertSchema as ak, accountCredentialsSelectSchema as al, accountCredentialsUpdateSchema as am, accountInsertSchema as an, accountSelectSchema as ao, accountUpdateSchema as ap, hasPaymentAccountAssigned as aq, isBatchAuthorized as ar, isBatchCompleted as as, isBatchFailed as at, isBatchInitiated as au, isBatchProcessing as av, isBatchReadyToSign as aw, isPaymentCompleted as ax, isPendingStatus as ay, isProcessedStatus as az, tables as t, ACCOUNT_STATUSES as y };
|
|
5461
|
+
export type { ChargeBearer as $, AccountSelectType as A, BatchSelectType as B, ConnectorConfig as C, AccountCredentialsSelectType as D, AccountCredentialsUpdateType as E, AccountPatchType as F, AccountStatus as G, HandleAuthorizationCallbackInput as H, AccountUpdateType as J, AuthorizedBatch as K, LastSyncMetadata as L, PaymentRequestSelectType as P, BankAccountWithLastSync as Q, BankCode as R, BatchInsertType as S, BatchLifecycle as T, BatchMode as U, BatchPayment as V, BatchStatus as W, PaymentSelectType as a, CompletedBatch as a0, CountryCode as a1, CredentialsType as a2, InstructionPriority as a4, PaymentDirection as a9, PaymentFailedInsertType as aa, PaymentInsertType as ab, PaymentLifecycle as ac, PaymentPreparedInsertType as ad, PaymentStatus as ae, ProcessingBatch as af, ReadyToSignBatch as ag, ResolvedCredentials as ah, TokenType as aj, ConnectorKey as b, ConfigEnvironmentBank as c, PaymentType as d, CurrencyCode as e, HandleAuthorizationCallbackOutput as f, ConnectedAccount as g, CredentialsResolver as h, AccountCredentialsInsertType as i, AccountInsertType as j, BatchedPayment as k, InitiatedBatch as l, IncomingPayment as m, InitiatedPayment as n, ParsedBankPayment as o, PaymentRequestStatus as p, AuthorizationCallbackResult as q, BatchMetadata as r, Currency as s, AccountAssignedPayment as u, PreparedPayment as v, CompletedPayment as w, PaymentRequestInsertType as x, AccountCredentialsPatchType as z };
|
|
@@ -5457,5 +5457,5 @@ type ParsedBankPayment = {
|
|
|
5457
5457
|
*/
|
|
5458
5458
|
type BatchPayment = Omit<PaymentInsertType, 'bankRefId'>;
|
|
5459
5459
|
|
|
5460
|
-
export {
|
|
5461
|
-
export type { AccountSelectType as A, BatchSelectType as B, ConnectorConfig as C, AccountCredentialsSelectType as D,
|
|
5460
|
+
export { IBankConnector as I, BASE_TERMINAL_STATUSES as M, BATCH_MODES as N, BATCH_STATUSES as O, CHARGE_BEARERS as X, CONNECTOR_KEYS as Y, COUNTRY_CODES as Z, CREDENTIALS_TYPES as _, INSTRUCTION_PRIORITIES as a3, PAYMENT_DIRECTIONS as a5, PAYMENT_REQUEST_STATUSES as a6, PAYMENT_STATUSES as a7, PAYMENT_TYPES as a8, isTerminalStatus as aA, account as aB, accountCredentials as aC, batch as aD, ott as aE, payment as aF, paymentRequest as aG, TOKEN_TYPES as ai, accountCredentialsInsertSchema as ak, accountCredentialsSelectSchema as al, accountCredentialsUpdateSchema as am, accountInsertSchema as an, accountSelectSchema as ao, accountUpdateSchema as ap, hasPaymentAccountAssigned as aq, isBatchAuthorized as ar, isBatchCompleted as as, isBatchFailed as at, isBatchInitiated as au, isBatchProcessing as av, isBatchReadyToSign as aw, isPaymentCompleted as ax, isPendingStatus as ay, isProcessedStatus as az, tables as t, ACCOUNT_STATUSES as y };
|
|
5461
|
+
export type { ChargeBearer as $, AccountSelectType as A, BatchSelectType as B, ConnectorConfig as C, AccountCredentialsSelectType as D, AccountCredentialsUpdateType as E, AccountPatchType as F, AccountStatus as G, HandleAuthorizationCallbackInput as H, AccountUpdateType as J, AuthorizedBatch as K, LastSyncMetadata as L, PaymentRequestSelectType as P, BankAccountWithLastSync as Q, BankCode as R, BatchInsertType as S, BatchLifecycle as T, BatchMode as U, BatchPayment as V, BatchStatus as W, PaymentSelectType as a, CompletedBatch as a0, CountryCode as a1, CredentialsType as a2, InstructionPriority as a4, PaymentDirection as a9, PaymentFailedInsertType as aa, PaymentInsertType as ab, PaymentLifecycle as ac, PaymentPreparedInsertType as ad, PaymentStatus as ae, ProcessingBatch as af, ReadyToSignBatch as ag, ResolvedCredentials as ah, TokenType as aj, ConnectorKey as b, ConfigEnvironmentBank as c, PaymentType as d, CurrencyCode as e, HandleAuthorizationCallbackOutput as f, ConnectedAccount as g, CredentialsResolver as h, AccountCredentialsInsertType as i, AccountInsertType as j, BatchedPayment as k, InitiatedBatch as l, IncomingPayment as m, InitiatedPayment as n, ParsedBankPayment as o, PaymentRequestStatus as p, AuthorizationCallbackResult as q, BatchMetadata as r, Currency as s, AccountAssignedPayment as u, PreparedPayment as v, CompletedPayment as w, PaymentRequestInsertType as x, AccountCredentialsPatchType as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as CurrencyCode,
|
|
1
|
+
import { e as CurrencyCode, R as BankCode, a1 as CountryCode, P as PaymentRequestSelectType } from './bank.C7zoSV8F.cjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
|
|
@@ -912,6 +912,23 @@ class FinbricksConnector extends IBankConnector {
|
|
|
912
912
|
supportsPaymentType(paymentType) {
|
|
913
913
|
return paymentType === "DOMESTIC" || paymentType === "SEPA" || paymentType === "SWIFT";
|
|
914
914
|
}
|
|
915
|
+
/**
|
|
916
|
+
* ČSOB mandates the UDT and we are an obliged entity, so a missing one must
|
|
917
|
+
* fail the payment — buildUltimateCreditor used to drop it silently instead.
|
|
918
|
+
*/
|
|
919
|
+
assertUltimateCreditor(creditor, options) {
|
|
920
|
+
if (this.PROVIDER !== "CSOB") return;
|
|
921
|
+
if (buildUltimateCreditor(creditor, options)) return;
|
|
922
|
+
const missing = [
|
|
923
|
+
!creditor.holderName && "holder name",
|
|
924
|
+
!(creditor.address?.streetName ?? creditor.address?.buildingNumber) && "street address"
|
|
925
|
+
].filter(Boolean);
|
|
926
|
+
throw backendSdk.createInternalError(null, {
|
|
927
|
+
status: 422,
|
|
928
|
+
code: "VALID-B-019",
|
|
929
|
+
message: `\u010CSOB requires the recipient (UDT) in the payment's free-text field, but the creditor${creditor.holderName ? ` "${creditor.holderName}"` : ""} is missing its ${missing.join(" and ")}. Complete the counterparty data and retry.`
|
|
930
|
+
});
|
|
931
|
+
}
|
|
915
932
|
async getClientId(accountId) {
|
|
916
933
|
if (!this.resolveCredentials) {
|
|
917
934
|
throw backendSdk.createInternalError(null, {
|
|
@@ -1094,6 +1111,11 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1094
1111
|
message: `Batch for unauthorized client with iban: ${payments[0].debtor.iban}`
|
|
1095
1112
|
});
|
|
1096
1113
|
await this.getClientId(authorizedClient.id);
|
|
1114
|
+
for (const p of payments) {
|
|
1115
|
+
this.assertUltimateCreditor(p.creditor, {
|
|
1116
|
+
stripDiacritics: p.currency !== "CZK"
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1097
1119
|
const [response, error] = await backendSdk.useResult(
|
|
1098
1120
|
this.finbricks.request({
|
|
1099
1121
|
endpoint: FINBRICKS_ENDPOINTS.TRANSACTION_BATCH_INIT,
|
|
@@ -1141,15 +1163,6 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1141
1163
|
initiateForeignBatchImpl(_args) {
|
|
1142
1164
|
throw new Error("Finbricks: Foreign batch not implemented");
|
|
1143
1165
|
}
|
|
1144
|
-
/**
|
|
1145
|
-
* endToEndIdentification for the SEPA rail. Optional per the Finbricks spec —
|
|
1146
|
-
* return `undefined` to omit the field entirely, which some executing banks
|
|
1147
|
-
* need because they overwrite the remittance text with it (see
|
|
1148
|
-
* `CreditasConnector`).
|
|
1149
|
-
*/
|
|
1150
|
-
buildSepaEndToEndId(payment) {
|
|
1151
|
-
return this.buildEndToEndId(payment);
|
|
1152
|
-
}
|
|
1153
1166
|
async initiateForeignPayment(payment) {
|
|
1154
1167
|
const debtorAccount = this.connectedAccounts.find(
|
|
1155
1168
|
(acc) => acc.iban === payment.debtorIban
|
|
@@ -1172,6 +1185,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1172
1185
|
ks: payment.ks
|
|
1173
1186
|
});
|
|
1174
1187
|
const remittanceBase = [reference, payment.message?.trim()].filter(Boolean).join(" ") || void 0;
|
|
1188
|
+
this.assertUltimateCreditor(payment.creditor, {
|
|
1189
|
+
stripDiacritics: payment.currency !== "CZK"
|
|
1190
|
+
});
|
|
1175
1191
|
const unstructured = this.PROVIDER === "CSOB" ? composeWithUltimateCreditor(remittanceBase, payment.creditor, {
|
|
1176
1192
|
stripDiacritics: payment.currency !== "CZK"
|
|
1177
1193
|
}) : remittanceBase?.slice(0, 140) || void 0;
|
|
@@ -1247,9 +1263,9 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1247
1263
|
ss: payment.ss,
|
|
1248
1264
|
ks: payment.ks
|
|
1249
1265
|
});
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1252
|
-
|
|
1266
|
+
const udtOptions = { stripDiacritics: payment.currency !== "CZK" };
|
|
1267
|
+
this.assertUltimateCreditor(payment.creditor, udtOptions);
|
|
1268
|
+
const udt = this.PROVIDER === "CSOB" ? buildUltimateCreditor(payment.creditor, udtOptions) : void 0;
|
|
1253
1269
|
const reserved = (reference ? reference.length + 1 : 0) + (udt ? udt.length + 2 : 0);
|
|
1254
1270
|
const base = [message.slice(0, Math.max(0, 140 - reserved)), reference].filter(Boolean).join(" ");
|
|
1255
1271
|
const combined = udt ? base ? `${base}, ${udt}` : udt : base;
|
|
@@ -1257,10 +1273,6 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1257
1273
|
0,
|
|
1258
1274
|
140
|
|
1259
1275
|
);
|
|
1260
|
-
const endToEndIdentification = this.buildSepaEndToEndId({
|
|
1261
|
-
...payment,
|
|
1262
|
-
id: payment.id
|
|
1263
|
-
});
|
|
1264
1276
|
const bankRefId = backendSdk.uuidv4();
|
|
1265
1277
|
const [response, error] = await backendSdk.useResult(
|
|
1266
1278
|
this.finbricks.request({
|
|
@@ -1274,7 +1286,10 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1274
1286
|
},
|
|
1275
1287
|
paymentIdentification: {
|
|
1276
1288
|
merchantTransactionId: bankRefId,
|
|
1277
|
-
|
|
1289
|
+
endToEndIdentification: this.buildEndToEndId({
|
|
1290
|
+
...payment,
|
|
1291
|
+
id: payment.id
|
|
1292
|
+
})
|
|
1278
1293
|
},
|
|
1279
1294
|
amount: payment.amount,
|
|
1280
1295
|
debtor: {
|
|
@@ -1319,29 +1334,57 @@ class FinbricksConnector extends IBankConnector {
|
|
|
1319
1334
|
(acc) => acc.iban === payment.debtor.iban
|
|
1320
1335
|
);
|
|
1321
1336
|
await this.getClientId(debtorAccount.id);
|
|
1337
|
+
const debtorIban = resolveCzechDomesticIban(payment.debtor);
|
|
1338
|
+
const creditorIban = resolveCzechDomesticIban(payment.creditor);
|
|
1339
|
+
if (!creditorIban || !payment.creditor.holderName) {
|
|
1340
|
+
throw backendSdk.createInternalError(null, {
|
|
1341
|
+
status: 422,
|
|
1342
|
+
code: "VALID-B-018",
|
|
1343
|
+
message: `Domestic payment needs the creditor's ${!creditorIban ? "IBAN (or account number + bank code)" : "name"}.`
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1346
|
+
const udtOptions = { stripDiacritics: false };
|
|
1347
|
+
this.assertUltimateCreditor(payment.creditor, udtOptions);
|
|
1348
|
+
const composed = this.PROVIDER === "CSOB" ? composeWithUltimateCreditor(
|
|
1349
|
+
payment.message,
|
|
1350
|
+
payment.creditor,
|
|
1351
|
+
udtOptions
|
|
1352
|
+
) : payment.message?.trim() || void 0;
|
|
1353
|
+
const unstructured = this.PROVIDER === "CSOB" && (composed?.length ?? 0) < 3 ? "Platba" : composed;
|
|
1322
1354
|
const [response, error] = await backendSdk.useResult(
|
|
1323
1355
|
this.finbricks.request({
|
|
1324
1356
|
endpoint: FINBRICKS_ENDPOINTS.TRANSACTION_INIT,
|
|
1325
1357
|
method: "POST",
|
|
1326
1358
|
body: {
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1359
|
+
merchantIdentification: {
|
|
1360
|
+
merchantId: this.finbricks.MERCHANT_ID
|
|
1361
|
+
// TEMP: clientId disabled per client request — do not send.
|
|
1362
|
+
// clientId,
|
|
1363
|
+
},
|
|
1364
|
+
paymentIdentification: {
|
|
1365
|
+
merchantTransactionId: payment.id,
|
|
1366
|
+
czechSymbols: {
|
|
1367
|
+
variableSymbol: payment.vs ?? (payment.ss ? void 0 : autoVariableSymbol(payment.id)),
|
|
1368
|
+
specificSymbol: payment.ss ?? void 0,
|
|
1369
|
+
constantSymbol: payment.ks ?? void 0
|
|
1370
|
+
}
|
|
1371
|
+
},
|
|
1372
|
+
amount: {
|
|
1373
|
+
value: payment.amount,
|
|
1374
|
+
currency: payment.currency ?? "CZK"
|
|
1375
|
+
},
|
|
1376
|
+
debtor: {
|
|
1377
|
+
...debtorIban && {
|
|
1378
|
+
accountIdentification: { value: debtorIban, type: "IBAN" }
|
|
1379
|
+
},
|
|
1380
|
+
paymentProvider: this.PROVIDER
|
|
1381
|
+
},
|
|
1382
|
+
creditor: {
|
|
1383
|
+
accountIdentification: { value: creditorIban, type: "IBAN" },
|
|
1384
|
+
creditorName: payment.creditor.holderName.slice(0, 100)
|
|
1385
|
+
},
|
|
1386
|
+
...unstructured && { remittanceInformation: { unstructured } },
|
|
1341
1387
|
callbackUrl: `${this.finbricks.REDIRECT_URI}?type=paymentRequest&paymentRequestId=${payment.id}`,
|
|
1342
|
-
// TEMP: clientId disabled per client request — do not send.
|
|
1343
|
-
// clientId,
|
|
1344
|
-
paymentProvider: this.PROVIDER,
|
|
1345
1388
|
instructionPriority: toFinbricksPriority(payment.instructionPriority)
|
|
1346
1389
|
}
|
|
1347
1390
|
})
|
package/dist/types.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const paymentDirection = require('./shared/bank.
|
|
3
|
+
const paymentDirection = require('./shared/bank.Dzl159tr.cjs');
|
|
4
4
|
const database_schema = require('./shared/bank.Ca3jzmIb.cjs');
|
|
5
5
|
const batchLifecycle = require('./shared/bank.NF8bZBy0.cjs');
|
|
6
6
|
const generalCodes = require('@develit-io/general-codes');
|
package/dist/types.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { BankAccountMetadata, BaseEvent } from '@develit-io/backend-sdk';
|
|
2
|
+
import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.C7zoSV8F.cjs';
|
|
3
|
+
export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, E as AccountCredentialsUpdateType, F as AccountPatchType, G as AccountStatus, J as AccountUpdateType, K as AuthorizedBatch, M as BASE_TERMINAL_STATUSES, N as BATCH_MODES, O as BATCH_STATUES, O as BATCH_STATUSES, Q as BankAccountWithLastSync, R as BankCode, S as BatchInsertType, T as BatchLifecycle, U as BatchMode, V as BatchPayment, B as BatchSelectType, W as BatchStatus, X as CHARGE_BEARERS, Y as CONNECTOR_KEYS, Z as COUNTRY_CODES, _ as CREDENTIALS_TYPES, $ as ChargeBearer, a0 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a1 as CountryCode, a2 as CredentialsType, e as CurrencyCode, a3 as INSTRUCTION_PRIORITIES, a4 as InstructionPriority, L as LastSyncMetadata, a5 as PAYMENT_DIRECTIONS, a6 as PAYMENT_REQUEST_STATUSES, a7 as PAYMENT_STATUSES, a8 as PAYMENT_TYPES, a9 as PaymentDirection, aa as PaymentFailedInsertType, ab as PaymentInsertType, ac as PaymentLifecycle, ad as PaymentPreparedInsertType, ae as PaymentStatus, af as ProcessingBatch, ag as ReadyToSignBatch, ah as ResolvedCredentials, ai as TOKEN_TYPES, aj as TokenType, ak as accountCredentialsInsertSchema, al as accountCredentialsSelectSchema, am as accountCredentialsUpdateSchema, an as accountInsertSchema, ao as accountSelectSchema, ap as accountUpdateSchema, aq as hasPaymentAccountAssigned, ar as isBatchAuthorized, as as isBatchCompleted, at as isBatchFailed, au as isBatchInitiated, av as isBatchProcessing, aw as isBatchReadyToSign, ax as isPaymentCompleted, ay as isPendingStatus, az as isProcessedStatus, aA as isTerminalStatus } from './shared/bank.C7zoSV8F.cjs';
|
|
4
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.Dtw4Amqo.cjs';
|
|
5
|
+
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.Dtw4Amqo.cjs';
|
|
5
6
|
import { z } from 'zod';
|
|
6
|
-
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_orm_zod from 'drizzle-orm/zod';
|
|
8
8
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
9
9
|
export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
@@ -148,6 +148,52 @@ type FinbricksSepaPaymentBody = {
|
|
|
148
148
|
instructionPriority?: 'NORM' | 'INST';
|
|
149
149
|
callbackUrl: string;
|
|
150
150
|
};
|
|
151
|
+
type FinbricksDomesticPaymentBody = {
|
|
152
|
+
merchantIdentification: {
|
|
153
|
+
merchantId: string;
|
|
154
|
+
clientId?: string;
|
|
155
|
+
};
|
|
156
|
+
paymentIdentification: {
|
|
157
|
+
merchantTransactionId: string;
|
|
158
|
+
endToEndIdentification?: string;
|
|
159
|
+
czechSymbols?: {
|
|
160
|
+
variableSymbol?: string;
|
|
161
|
+
specificSymbol?: string;
|
|
162
|
+
constantSymbol?: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
amount: {
|
|
166
|
+
value: number;
|
|
167
|
+
currency: string;
|
|
168
|
+
};
|
|
169
|
+
debtor: {
|
|
170
|
+
accountIdentification?: {
|
|
171
|
+
value: string;
|
|
172
|
+
type: 'IBAN' | 'PHONE' | 'EMAIL' | 'TAXID';
|
|
173
|
+
};
|
|
174
|
+
debtorName?: string;
|
|
175
|
+
paymentProvider: FinbricksProvider;
|
|
176
|
+
};
|
|
177
|
+
creditor: {
|
|
178
|
+
accountIdentification: {
|
|
179
|
+
value: string;
|
|
180
|
+
type: 'IBAN' | 'PHONE' | 'EMAIL' | 'TAXID';
|
|
181
|
+
};
|
|
182
|
+
creditorName: string;
|
|
183
|
+
postalAddress?: {
|
|
184
|
+
streetName?: string;
|
|
185
|
+
buildingNumber?: string;
|
|
186
|
+
town?: string;
|
|
187
|
+
country?: string;
|
|
188
|
+
postalCode?: string;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
remittanceInformation?: {
|
|
192
|
+
unstructured?: string;
|
|
193
|
+
};
|
|
194
|
+
instructionPriority?: 'NORM' | 'INST';
|
|
195
|
+
callbackUrl: string;
|
|
196
|
+
};
|
|
151
197
|
type FinbricksForeignPaymentBody = {
|
|
152
198
|
merchantIdentification: {
|
|
153
199
|
merchantId: string;
|
|
@@ -288,6 +334,13 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
288
334
|
protected readonly finbricks: FinbricksClient;
|
|
289
335
|
protected readonly PROVIDER: FinbricksProvider;
|
|
290
336
|
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM, REDIRECT_URI, connectedAccounts, resolveCredentials, }: FinbricksConnectorConfig);
|
|
337
|
+
/**
|
|
338
|
+
* ČSOB mandates the UDT and we are an obliged entity, so a missing one must
|
|
339
|
+
* fail the payment — buildUltimateCreditor used to drop it silently instead.
|
|
340
|
+
*/
|
|
341
|
+
protected assertUltimateCreditor(creditor: BankAccountMetadata, options: {
|
|
342
|
+
stripDiacritics: boolean;
|
|
343
|
+
}): void;
|
|
291
344
|
private getClientId;
|
|
292
345
|
getAuthUri({ ott }: {
|
|
293
346
|
ott: string;
|
|
@@ -321,13 +374,6 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
321
374
|
batchId: string;
|
|
322
375
|
payments: BatchedPayment[];
|
|
323
376
|
}): Promise<InitiatedBatch>;
|
|
324
|
-
/**
|
|
325
|
-
* endToEndIdentification for the SEPA rail. Optional per the Finbricks spec —
|
|
326
|
-
* return `undefined` to omit the field entirely, which some executing banks
|
|
327
|
-
* need because they overwrite the remittance text with it (see
|
|
328
|
-
* `CreditasConnector`).
|
|
329
|
-
*/
|
|
330
|
-
protected buildSepaEndToEndId(payment: EndToEndIdPayment): string | undefined;
|
|
331
377
|
initiateForeignPayment(payment: IncomingPayment): Promise<InitiatedPayment>;
|
|
332
378
|
initiateSEPAPayment(payment: IncomingPayment): Promise<InitiatedPayment>;
|
|
333
379
|
initiateDomesticPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
@@ -1336,5 +1382,5 @@ declare function toCompletedPayment(payment: PreparedPayment, status: 'SETTLED'
|
|
|
1336
1382
|
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string | null): PaymentRequestInsertType;
|
|
1337
1383
|
declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
|
|
1338
1384
|
|
|
1339
|
-
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CredentialsResolver, CsobConnector, Currency, DbuConnector,
|
|
1340
|
-
export type { BankPaymentEvent, BankPaymentRequestEvent, DbuAccountConfig, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSepaPaymentBody, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
|
|
1385
|
+
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CredentialsResolver, CsobConnector, Currency, DbuConnector, ErsteConnector, FINBRICKS_ENDPOINTS, FinbricksAccount, FinbricksClient, FinbricksConnector, IBankConnector, IncomingPayment, IncomingPayment as IncomingPaymentMessage, InitiatedBatch, InitiatedPayment, KBConnector, MockCobsConnector, MockConnector, ParsedBankPayment, PaymentRequestInsertType, PaymentRequestSelectType, PaymentRequestStatus, PaymentSelectType, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, dbuAccountConfigSchema, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toBatchedPaymentFromPaymentRequest, toCompletedPayment, toIncomingPayment, toPaymentRequestInsert, toPreparedPayment, useFinbricksFetch };
|
|
1386
|
+
export type { BankPaymentEvent, BankPaymentRequestEvent, DbuAccountConfig, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksDomesticPaymentBody, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSepaPaymentBody, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { BankAccountMetadata, BaseEvent } from '@develit-io/backend-sdk';
|
|
2
|
+
import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.C7zoSV8F.mjs';
|
|
3
|
+
export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, E as AccountCredentialsUpdateType, F as AccountPatchType, G as AccountStatus, J as AccountUpdateType, K as AuthorizedBatch, M as BASE_TERMINAL_STATUSES, N as BATCH_MODES, O as BATCH_STATUES, O as BATCH_STATUSES, Q as BankAccountWithLastSync, R as BankCode, S as BatchInsertType, T as BatchLifecycle, U as BatchMode, V as BatchPayment, B as BatchSelectType, W as BatchStatus, X as CHARGE_BEARERS, Y as CONNECTOR_KEYS, Z as COUNTRY_CODES, _ as CREDENTIALS_TYPES, $ as ChargeBearer, a0 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a1 as CountryCode, a2 as CredentialsType, e as CurrencyCode, a3 as INSTRUCTION_PRIORITIES, a4 as InstructionPriority, L as LastSyncMetadata, a5 as PAYMENT_DIRECTIONS, a6 as PAYMENT_REQUEST_STATUSES, a7 as PAYMENT_STATUSES, a8 as PAYMENT_TYPES, a9 as PaymentDirection, aa as PaymentFailedInsertType, ab as PaymentInsertType, ac as PaymentLifecycle, ad as PaymentPreparedInsertType, ae as PaymentStatus, af as ProcessingBatch, ag as ReadyToSignBatch, ah as ResolvedCredentials, ai as TOKEN_TYPES, aj as TokenType, ak as accountCredentialsInsertSchema, al as accountCredentialsSelectSchema, am as accountCredentialsUpdateSchema, an as accountInsertSchema, ao as accountSelectSchema, ap as accountUpdateSchema, aq as hasPaymentAccountAssigned, ar as isBatchAuthorized, as as isBatchCompleted, at as isBatchFailed, au as isBatchInitiated, av as isBatchProcessing, aw as isBatchReadyToSign, ax as isPaymentCompleted, ay as isPendingStatus, az as isProcessedStatus, aA as isTerminalStatus } from './shared/bank.C7zoSV8F.mjs';
|
|
4
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.BBNHHD0v.mjs';
|
|
5
|
+
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.BBNHHD0v.mjs';
|
|
5
6
|
import { z } from 'zod';
|
|
6
|
-
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_orm_zod from 'drizzle-orm/zod';
|
|
8
8
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
9
9
|
export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
@@ -148,6 +148,52 @@ type FinbricksSepaPaymentBody = {
|
|
|
148
148
|
instructionPriority?: 'NORM' | 'INST';
|
|
149
149
|
callbackUrl: string;
|
|
150
150
|
};
|
|
151
|
+
type FinbricksDomesticPaymentBody = {
|
|
152
|
+
merchantIdentification: {
|
|
153
|
+
merchantId: string;
|
|
154
|
+
clientId?: string;
|
|
155
|
+
};
|
|
156
|
+
paymentIdentification: {
|
|
157
|
+
merchantTransactionId: string;
|
|
158
|
+
endToEndIdentification?: string;
|
|
159
|
+
czechSymbols?: {
|
|
160
|
+
variableSymbol?: string;
|
|
161
|
+
specificSymbol?: string;
|
|
162
|
+
constantSymbol?: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
amount: {
|
|
166
|
+
value: number;
|
|
167
|
+
currency: string;
|
|
168
|
+
};
|
|
169
|
+
debtor: {
|
|
170
|
+
accountIdentification?: {
|
|
171
|
+
value: string;
|
|
172
|
+
type: 'IBAN' | 'PHONE' | 'EMAIL' | 'TAXID';
|
|
173
|
+
};
|
|
174
|
+
debtorName?: string;
|
|
175
|
+
paymentProvider: FinbricksProvider;
|
|
176
|
+
};
|
|
177
|
+
creditor: {
|
|
178
|
+
accountIdentification: {
|
|
179
|
+
value: string;
|
|
180
|
+
type: 'IBAN' | 'PHONE' | 'EMAIL' | 'TAXID';
|
|
181
|
+
};
|
|
182
|
+
creditorName: string;
|
|
183
|
+
postalAddress?: {
|
|
184
|
+
streetName?: string;
|
|
185
|
+
buildingNumber?: string;
|
|
186
|
+
town?: string;
|
|
187
|
+
country?: string;
|
|
188
|
+
postalCode?: string;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
remittanceInformation?: {
|
|
192
|
+
unstructured?: string;
|
|
193
|
+
};
|
|
194
|
+
instructionPriority?: 'NORM' | 'INST';
|
|
195
|
+
callbackUrl: string;
|
|
196
|
+
};
|
|
151
197
|
type FinbricksForeignPaymentBody = {
|
|
152
198
|
merchantIdentification: {
|
|
153
199
|
merchantId: string;
|
|
@@ -288,6 +334,13 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
288
334
|
protected readonly finbricks: FinbricksClient;
|
|
289
335
|
protected readonly PROVIDER: FinbricksProvider;
|
|
290
336
|
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM, REDIRECT_URI, connectedAccounts, resolveCredentials, }: FinbricksConnectorConfig);
|
|
337
|
+
/**
|
|
338
|
+
* ČSOB mandates the UDT and we are an obliged entity, so a missing one must
|
|
339
|
+
* fail the payment — buildUltimateCreditor used to drop it silently instead.
|
|
340
|
+
*/
|
|
341
|
+
protected assertUltimateCreditor(creditor: BankAccountMetadata, options: {
|
|
342
|
+
stripDiacritics: boolean;
|
|
343
|
+
}): void;
|
|
291
344
|
private getClientId;
|
|
292
345
|
getAuthUri({ ott }: {
|
|
293
346
|
ott: string;
|
|
@@ -321,13 +374,6 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
321
374
|
batchId: string;
|
|
322
375
|
payments: BatchedPayment[];
|
|
323
376
|
}): Promise<InitiatedBatch>;
|
|
324
|
-
/**
|
|
325
|
-
* endToEndIdentification for the SEPA rail. Optional per the Finbricks spec —
|
|
326
|
-
* return `undefined` to omit the field entirely, which some executing banks
|
|
327
|
-
* need because they overwrite the remittance text with it (see
|
|
328
|
-
* `CreditasConnector`).
|
|
329
|
-
*/
|
|
330
|
-
protected buildSepaEndToEndId(payment: EndToEndIdPayment): string | undefined;
|
|
331
377
|
initiateForeignPayment(payment: IncomingPayment): Promise<InitiatedPayment>;
|
|
332
378
|
initiateSEPAPayment(payment: IncomingPayment): Promise<InitiatedPayment>;
|
|
333
379
|
initiateDomesticPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
@@ -1336,5 +1382,5 @@ declare function toCompletedPayment(payment: PreparedPayment, status: 'SETTLED'
|
|
|
1336
1382
|
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string | null): PaymentRequestInsertType;
|
|
1337
1383
|
declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
|
|
1338
1384
|
|
|
1339
|
-
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CredentialsResolver, CsobConnector, Currency, DbuConnector,
|
|
1340
|
-
export type { BankPaymentEvent, BankPaymentRequestEvent, DbuAccountConfig, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSepaPaymentBody, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
|
|
1385
|
+
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CredentialsResolver, CsobConnector, Currency, DbuConnector, ErsteConnector, FINBRICKS_ENDPOINTS, FinbricksAccount, FinbricksClient, FinbricksConnector, IBankConnector, IncomingPayment, IncomingPayment as IncomingPaymentMessage, InitiatedBatch, InitiatedPayment, KBConnector, MockCobsConnector, MockConnector, ParsedBankPayment, PaymentRequestInsertType, PaymentRequestSelectType, PaymentRequestStatus, PaymentSelectType, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, dbuAccountConfigSchema, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toBatchedPaymentFromPaymentRequest, toCompletedPayment, toIncomingPayment, toPaymentRequestInsert, toPreparedPayment, useFinbricksFetch };
|
|
1386
|
+
export type { BankPaymentEvent, BankPaymentRequestEvent, DbuAccountConfig, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksDomesticPaymentBody, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSepaPaymentBody, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { BankAccountMetadata, BaseEvent } from '@develit-io/backend-sdk';
|
|
2
|
+
import { I as IBankConnector, b as ConnectorKey, g as ConnectedAccount, d as PaymentType, h as CredentialsResolver, i as AccountCredentialsInsertType, j as AccountInsertType, k as BatchedPayment, l as InitiatedBatch, m as IncomingPayment, n as InitiatedPayment, A as AccountSelectType, o as ParsedBankPayment, p as PaymentRequestStatus, q as AuthorizationCallbackResult, r as BatchMetadata, s as Currency, a as PaymentSelectType, P as PaymentRequestSelectType, u as AccountAssignedPayment, v as PreparedPayment, w as CompletedPayment, x as PaymentRequestInsertType } from './shared/bank.C7zoSV8F.js';
|
|
3
|
+
export { y as ACCOUNT_STATUSES, z as AccountCredentialsPatchType, D as AccountCredentialsSelectType, E as AccountCredentialsUpdateType, F as AccountPatchType, G as AccountStatus, J as AccountUpdateType, K as AuthorizedBatch, M as BASE_TERMINAL_STATUSES, N as BATCH_MODES, O as BATCH_STATUES, O as BATCH_STATUSES, Q as BankAccountWithLastSync, R as BankCode, S as BatchInsertType, T as BatchLifecycle, U as BatchMode, V as BatchPayment, B as BatchSelectType, W as BatchStatus, X as CHARGE_BEARERS, Y as CONNECTOR_KEYS, Z as COUNTRY_CODES, _ as CREDENTIALS_TYPES, $ as ChargeBearer, a0 as CompletedBatch, c as ConfigEnvironmentBank, C as ConnectorConfig, a1 as CountryCode, a2 as CredentialsType, e as CurrencyCode, a3 as INSTRUCTION_PRIORITIES, a4 as InstructionPriority, L as LastSyncMetadata, a5 as PAYMENT_DIRECTIONS, a6 as PAYMENT_REQUEST_STATUSES, a7 as PAYMENT_STATUSES, a8 as PAYMENT_TYPES, a9 as PaymentDirection, aa as PaymentFailedInsertType, ab as PaymentInsertType, ac as PaymentLifecycle, ad as PaymentPreparedInsertType, ae as PaymentStatus, af as ProcessingBatch, ag as ReadyToSignBatch, ah as ResolvedCredentials, ai as TOKEN_TYPES, aj as TokenType, ak as accountCredentialsInsertSchema, al as accountCredentialsSelectSchema, am as accountCredentialsUpdateSchema, an as accountInsertSchema, ao as accountSelectSchema, ap as accountUpdateSchema, aq as hasPaymentAccountAssigned, ar as isBatchAuthorized, as as isBatchCompleted, at as isBatchFailed, au as isBatchInitiated, av as isBatchProcessing, aw as isBatchReadyToSign, ax as isPaymentCompleted, ay as isPendingStatus, az as isProcessedStatus, aA as isTerminalStatus } from './shared/bank.C7zoSV8F.js';
|
|
4
|
+
import { d as FinbricksAccount, R as ReferenceType, S as SendPaymentInput } from './shared/bank.BO2rCT2t.js';
|
|
5
|
+
export { e as FinbricksAccountTransactionsResponse, f as FinbricksAccountsListResponse, g as FinbricksAuthTokenResponse, h as FinbricksBatchResponse, i as FinbricksConnectAccountResponse, j as FinbricksPaymentResponse, k as FinbricksSupportedBank, F as FinbricksSupportedBanksResponse, b as SendPaymentSyncInput } from './shared/bank.BO2rCT2t.js';
|
|
5
6
|
import { z } from 'zod';
|
|
6
|
-
import { BaseEvent } from '@develit-io/backend-sdk';
|
|
7
7
|
import * as drizzle_orm_zod from 'drizzle-orm/zod';
|
|
8
8
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
9
9
|
export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|
|
@@ -148,6 +148,52 @@ type FinbricksSepaPaymentBody = {
|
|
|
148
148
|
instructionPriority?: 'NORM' | 'INST';
|
|
149
149
|
callbackUrl: string;
|
|
150
150
|
};
|
|
151
|
+
type FinbricksDomesticPaymentBody = {
|
|
152
|
+
merchantIdentification: {
|
|
153
|
+
merchantId: string;
|
|
154
|
+
clientId?: string;
|
|
155
|
+
};
|
|
156
|
+
paymentIdentification: {
|
|
157
|
+
merchantTransactionId: string;
|
|
158
|
+
endToEndIdentification?: string;
|
|
159
|
+
czechSymbols?: {
|
|
160
|
+
variableSymbol?: string;
|
|
161
|
+
specificSymbol?: string;
|
|
162
|
+
constantSymbol?: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
amount: {
|
|
166
|
+
value: number;
|
|
167
|
+
currency: string;
|
|
168
|
+
};
|
|
169
|
+
debtor: {
|
|
170
|
+
accountIdentification?: {
|
|
171
|
+
value: string;
|
|
172
|
+
type: 'IBAN' | 'PHONE' | 'EMAIL' | 'TAXID';
|
|
173
|
+
};
|
|
174
|
+
debtorName?: string;
|
|
175
|
+
paymentProvider: FinbricksProvider;
|
|
176
|
+
};
|
|
177
|
+
creditor: {
|
|
178
|
+
accountIdentification: {
|
|
179
|
+
value: string;
|
|
180
|
+
type: 'IBAN' | 'PHONE' | 'EMAIL' | 'TAXID';
|
|
181
|
+
};
|
|
182
|
+
creditorName: string;
|
|
183
|
+
postalAddress?: {
|
|
184
|
+
streetName?: string;
|
|
185
|
+
buildingNumber?: string;
|
|
186
|
+
town?: string;
|
|
187
|
+
country?: string;
|
|
188
|
+
postalCode?: string;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
remittanceInformation?: {
|
|
192
|
+
unstructured?: string;
|
|
193
|
+
};
|
|
194
|
+
instructionPriority?: 'NORM' | 'INST';
|
|
195
|
+
callbackUrl: string;
|
|
196
|
+
};
|
|
151
197
|
type FinbricksForeignPaymentBody = {
|
|
152
198
|
merchantIdentification: {
|
|
153
199
|
merchantId: string;
|
|
@@ -288,6 +334,13 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
288
334
|
protected readonly finbricks: FinbricksClient;
|
|
289
335
|
protected readonly PROVIDER: FinbricksProvider;
|
|
290
336
|
constructor(provider: FinbricksProvider, { BASE_URI, MERCHANT_ID, PRIVATE_KEY_PEM, REDIRECT_URI, connectedAccounts, resolveCredentials, }: FinbricksConnectorConfig);
|
|
337
|
+
/**
|
|
338
|
+
* ČSOB mandates the UDT and we are an obliged entity, so a missing one must
|
|
339
|
+
* fail the payment — buildUltimateCreditor used to drop it silently instead.
|
|
340
|
+
*/
|
|
341
|
+
protected assertUltimateCreditor(creditor: BankAccountMetadata, options: {
|
|
342
|
+
stripDiacritics: boolean;
|
|
343
|
+
}): void;
|
|
291
344
|
private getClientId;
|
|
292
345
|
getAuthUri({ ott }: {
|
|
293
346
|
ott: string;
|
|
@@ -321,13 +374,6 @@ declare abstract class FinbricksConnector extends IBankConnector {
|
|
|
321
374
|
batchId: string;
|
|
322
375
|
payments: BatchedPayment[];
|
|
323
376
|
}): Promise<InitiatedBatch>;
|
|
324
|
-
/**
|
|
325
|
-
* endToEndIdentification for the SEPA rail. Optional per the Finbricks spec —
|
|
326
|
-
* return `undefined` to omit the field entirely, which some executing banks
|
|
327
|
-
* need because they overwrite the remittance text with it (see
|
|
328
|
-
* `CreditasConnector`).
|
|
329
|
-
*/
|
|
330
|
-
protected buildSepaEndToEndId(payment: EndToEndIdPayment): string | undefined;
|
|
331
377
|
initiateForeignPayment(payment: IncomingPayment): Promise<InitiatedPayment>;
|
|
332
378
|
initiateSEPAPayment(payment: IncomingPayment): Promise<InitiatedPayment>;
|
|
333
379
|
initiateDomesticPayment(payment: BatchedPayment): Promise<InitiatedPayment>;
|
|
@@ -1336,5 +1382,5 @@ declare function toCompletedPayment(payment: PreparedPayment, status: 'SETTLED'
|
|
|
1336
1382
|
declare function toPaymentRequestInsert(payment: AccountAssignedPayment, batchId: string | null): PaymentRequestInsertType;
|
|
1337
1383
|
declare function toBatchedPaymentFromPaymentRequest(sp: PaymentRequestSelectType): BatchedPayment;
|
|
1338
1384
|
|
|
1339
|
-
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CredentialsResolver, CsobConnector, Currency, DbuConnector,
|
|
1340
|
-
export type { BankPaymentEvent, BankPaymentRequestEvent, DbuAccountConfig, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSepaPaymentBody, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
|
|
1385
|
+
export { AccountAssignedPayment, AccountCredentialsInsertType, AccountInsertType, AccountSelectType, BatchMetadata, BatchedPayment, CompletedPayment, ConnectedAccount, ConnectorKey, CredentialsResolver, CsobConnector, Currency, DbuConnector, ErsteConnector, FINBRICKS_ENDPOINTS, FinbricksAccount, FinbricksClient, FinbricksConnector, IBankConnector, IncomingPayment, IncomingPayment as IncomingPaymentMessage, InitiatedBatch, InitiatedPayment, KBConnector, MockCobsConnector, MockConnector, ParsedBankPayment, PaymentRequestInsertType, PaymentRequestSelectType, PaymentRequestStatus, PaymentSelectType, PaymentType, PreparedPayment, SendPaymentInput, assignAccount, dbuAccountConfigSchema, ottInsertSchema, ottSelectSchema, ottUpdateSchema, signFinbricksJws, toBatchedPayment, toBatchedPaymentFromPaymentRequest, toCompletedPayment, toIncomingPayment, toPaymentRequestInsert, toPreparedPayment, useFinbricksFetch };
|
|
1386
|
+
export type { BankPaymentEvent, BankPaymentRequestEvent, DbuAccountConfig, DbuConnectorConfig, ErsteAuthenticationResponse, ErsteBatchPaymentInitiationResponse, ErsteIncomingPaymentResponse, ErsteObtainAuthorizationURLResponse, ErstePaymentInitiationResponse, FinbricksBatchBody, FinbricksBatchStatus, FinbricksConnectAccountBody, FinbricksConnectorConfig, FinbricksDomesticPaymentBody, FinbricksEndpoint, FinbricksEndpointPath, FinbricksFetchConfig, FinbricksForeignPaymentBody, FinbricksGetBatchStatusBody, FinbricksGetBatchStatusResponse, FinbricksGetTransactionStatusResponse, FinbricksJWSData, FinbricksPaymentBody, FinbricksProvider, FinbricksRequestInit, FinbricksSepaPaymentBody, FinbricksSupportedBanksQuery, FinbricksTransactionStatus, OneTimeTokenInsertType, OneTimeTokenPatchType, OneTimeTokenSelectType, OneTimeTokenUpdateType };
|
package/dist/types.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BASE_TERMINAL_STATUSES, C as CsobConnector, D as DbuConnector, E as ErsteConnector, F as FINBRICKS_ENDPOINTS, a as FinbricksClient, b as FinbricksConnector, I as IBankConnector, K as KBConnector, M as MockCobsConnector, c as MockConnector, d as accountCredentialsInsertSchema, e as accountCredentialsSelectSchema, f as accountCredentialsUpdateSchema, g as accountInsertSchema, h as accountSelectSchema, i as accountUpdateSchema, j as assignAccount, k as dbuAccountConfigSchema, l as hasPaymentAccountAssigned, m as isPaymentCompleted, n as isPendingStatus, o as isProcessedStatus, p as isTerminalStatus, q as ottInsertSchema, r as ottSelectSchema, s as ottUpdateSchema, t as signFinbricksJws, u as toBatchedPayment, v as toBatchedPaymentFromPaymentRequest, w as toCompletedPayment, x as toIncomingPayment, y as toPaymentRequestInsert, z as toPreparedPayment, A as useFinbricksFetch } from './shared/bank.
|
|
1
|
+
export { B as BASE_TERMINAL_STATUSES, C as CsobConnector, D as DbuConnector, E as ErsteConnector, F as FINBRICKS_ENDPOINTS, a as FinbricksClient, b as FinbricksConnector, I as IBankConnector, K as KBConnector, M as MockCobsConnector, c as MockConnector, d as accountCredentialsInsertSchema, e as accountCredentialsSelectSchema, f as accountCredentialsUpdateSchema, g as accountInsertSchema, h as accountSelectSchema, i as accountUpdateSchema, j as assignAccount, k as dbuAccountConfigSchema, l as hasPaymentAccountAssigned, m as isPaymentCompleted, n as isPendingStatus, o as isProcessedStatus, p as isTerminalStatus, q as ottInsertSchema, r as ottSelectSchema, s as ottUpdateSchema, t as signFinbricksJws, u as toBatchedPayment, v as toBatchedPaymentFromPaymentRequest, w as toCompletedPayment, x as toIncomingPayment, y as toPaymentRequestInsert, z as toPreparedPayment, A as useFinbricksFetch } from './shared/bank.B-y4t5NI.mjs';
|
|
2
2
|
export { A as ACCOUNT_STATUSES, B as BATCH_MODES, a as BATCH_STATUES, a as BATCH_STATUSES, C as CHARGE_BEARERS, b as CONNECTOR_KEYS, c as COUNTRY_CODES, d as CREDENTIALS_TYPES, I as INSTRUCTION_PRIORITIES, P as PAYMENT_DIRECTIONS, e as PAYMENT_REQUEST_STATUSES, f as PAYMENT_STATUSES, g as PAYMENT_TYPES, T as TOKEN_TYPES } from './shared/bank.BT7HayCV.mjs';
|
|
3
3
|
export { i as isBatchAuthorized, a as isBatchCompleted, b as isBatchFailed, c as isBatchInitiated, d as isBatchProcessing, e as isBatchReadyToSign } from './shared/bank.XqSw509X.mjs';
|
|
4
4
|
export { BANK_CODES, CURRENCY_CODES } from '@develit-io/general-codes';
|