@develit-services/bank 2.2.1 → 2.2.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.
@@ -5,7 +5,7 @@ const database_schema = require('../shared/bank.CIWYI18z.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
- const mock_connector = require('../shared/bank.C8oW81NT.cjs');
8
+ const mock_connector = require('../shared/bank.CQfKMyzc.cjs');
9
9
  require('jose');
10
10
  const zod = require('zod');
11
11
  const generalCodes = require('@develit-io/general-codes');
@@ -3,7 +3,7 @@ import { v as tables, I as INSTRUCTION_PRIORITIES, C as CHARGE_BEARERS, g as PAY
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
- import { j as initiateConnector, g as toIncomingPayment, d as assignAccount, t as toBatchedPayment, h as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from '../shared/bank.aSyaZEZI.mjs';
6
+ import { j as initiateConnector, g as toIncomingPayment, d as assignAccount, t as toBatchedPayment, h as toPaymentRequestInsert, a as FinbricksClient, F as FINBRICKS_ENDPOINTS } from '../shared/bank.CmgGdN-q.mjs';
7
7
  import 'jose';
8
8
  import { z } from 'zod';
9
9
  import { CURRENCY_CODES } from '@develit-io/general-codes';
@@ -3,7 +3,7 @@
3
3
  const backendSdk = require('@develit-io/backend-sdk');
4
4
  const database_schema = require('../shared/bank.CIWYI18z.cjs');
5
5
  const batchLifecycle = require('../shared/bank.NF8bZBy0.cjs');
6
- const mock_connector = require('../shared/bank.C8oW81NT.cjs');
6
+ const mock_connector = require('../shared/bank.CQfKMyzc.cjs');
7
7
  const drizzleOrm = require('drizzle-orm');
8
8
  const credentialsResolver = require('../shared/bank.B0EWZbAs.cjs');
9
9
  const cloudflare_workers = require('cloudflare:workers');
@@ -1,7 +1,7 @@
1
1
  import { first, uuidv4, asNonEmpty } from '@develit-io/backend-sdk';
2
2
  import { v as tables, o as isPaymentCompleted } from '../shared/bank.C7MA33AX.mjs';
3
3
  import { i as isBatchAuthorized, b as isBatchFailed, d as isBatchProcessing } from '../shared/bank.XqSw509X.mjs';
4
- import { e as toBatchedPaymentFromPaymentRequest, i as toPreparedPayment, j as initiateConnector } from '../shared/bank.aSyaZEZI.mjs';
4
+ import { e as toBatchedPaymentFromPaymentRequest, i as toPreparedPayment, j as initiateConnector } from '../shared/bank.CmgGdN-q.mjs';
5
5
  import { eq, and, inArray } from 'drizzle-orm';
6
6
  import { g as getBatchByIdQuery, a as getPaymentRequestsByBatchIdQuery, c as checksum, u as upsertBatchCommand, b as getAccountByIdQuery, d as createCredentialsResolver, e as updatePaymentRequestStatusCommand, f as createPaymentCommand } from '../shared/bank.UBWdag5k.mjs';
7
7
  import { WorkflowEntrypoint } from 'cloudflare:workers';
@@ -496,7 +496,7 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
496
496
  const isIncoming = tx.creditDebitIndicator === "CRDT";
497
497
  const related = tx.entryDetails?.transactionDetails?.relatedParties;
498
498
  const endToEndId = tx.entryDetails.transactionDetails?.references?.endToEndIdentification;
499
- const symbolsRegex = /^[-/]?VS\d+/;
499
+ const symbolsRegex = /^\/?VS\d+/;
500
500
  const base = {
501
501
  id: backendSdk.uuidv4(),
502
502
  correlationId: backendSdk.uuidv4(),
@@ -880,6 +880,8 @@ class FinbricksConnector extends IBankConnector {
880
880
  );
881
881
  const clientId = await this.getClientId(debtorAccount.id);
882
882
  const creditorAddress = mapToFinbricksAddress(payment.creditor.address);
883
+ const message = payment.message?.trim() ?? "";
884
+ const unstructured = message.length >= 3 ? message.slice(0, 140) : "Platba";
883
885
  const bankRefId = backendSdk.uuidv4();
884
886
  const [response, error] = await backendSdk.useResult(
885
887
  this.finbricks.request({
@@ -905,6 +907,7 @@ class FinbricksConnector extends IBankConnector {
905
907
  creditorName: payment.creditor.holderName,
906
908
  ...creditorAddress && { postalAddress: creditorAddress }
907
909
  },
910
+ remittanceInformation: { unstructured },
908
911
  callbackUrl: `${this.finbricks.REDIRECT_URI}?type=paymentRequest&paymentRequestId=${payment.id}`
909
912
  }
910
913
  })
@@ -1137,11 +1140,16 @@ class MonetaConnector extends FinbricksConnector {
1137
1140
  return paymentType === "DOMESTIC";
1138
1141
  }
1139
1142
  /**
1140
- * MONETA rejects `/` in endToEndIdentification — use `-` as separator.
1143
+ * MONETA rejects all special characters in endToEndIdentification.
1144
+ * Boundaries between segments are unambiguous without a separator —
1145
+ * `VS`/`SS`/`KS` prefixes are alphabetic and values are always numeric,
1146
+ * so the parsing regex `VS[:\s]*(\d+)` extracts each value correctly.
1147
+ *
1148
+ * Format: `VS1234SS5678KS0308` (max 30 chars).
1141
1149
  * Confirmed by Finbricks support (2026-04-23).
1142
1150
  */
1143
1151
  buildEndToEndId(payment) {
1144
- return buildEndToEndId(payment, { separator: "-" });
1152
+ return buildEndToEndId(payment, { separator: "" });
1145
1153
  }
1146
1154
  }
1147
1155
 
@@ -494,7 +494,7 @@ const mapFinbricksTransactionToPayment = (tx, account) => {
494
494
  const isIncoming = tx.creditDebitIndicator === "CRDT";
495
495
  const related = tx.entryDetails?.transactionDetails?.relatedParties;
496
496
  const endToEndId = tx.entryDetails.transactionDetails?.references?.endToEndIdentification;
497
- const symbolsRegex = /^[-/]?VS\d+/;
497
+ const symbolsRegex = /^\/?VS\d+/;
498
498
  const base = {
499
499
  id: uuidv4(),
500
500
  correlationId: uuidv4(),
@@ -878,6 +878,8 @@ class FinbricksConnector extends IBankConnector {
878
878
  );
879
879
  const clientId = await this.getClientId(debtorAccount.id);
880
880
  const creditorAddress = mapToFinbricksAddress(payment.creditor.address);
881
+ const message = payment.message?.trim() ?? "";
882
+ const unstructured = message.length >= 3 ? message.slice(0, 140) : "Platba";
881
883
  const bankRefId = uuidv4();
882
884
  const [response, error] = await useResult(
883
885
  this.finbricks.request({
@@ -903,6 +905,7 @@ class FinbricksConnector extends IBankConnector {
903
905
  creditorName: payment.creditor.holderName,
904
906
  ...creditorAddress && { postalAddress: creditorAddress }
905
907
  },
908
+ remittanceInformation: { unstructured },
906
909
  callbackUrl: `${this.finbricks.REDIRECT_URI}?type=paymentRequest&paymentRequestId=${payment.id}`
907
910
  }
908
911
  })
@@ -1135,11 +1138,16 @@ class MonetaConnector extends FinbricksConnector {
1135
1138
  return paymentType === "DOMESTIC";
1136
1139
  }
1137
1140
  /**
1138
- * MONETA rejects `/` in endToEndIdentification — use `-` as separator.
1141
+ * MONETA rejects all special characters in endToEndIdentification.
1142
+ * Boundaries between segments are unambiguous without a separator —
1143
+ * `VS`/`SS`/`KS` prefixes are alphabetic and values are always numeric,
1144
+ * so the parsing regex `VS[:\s]*(\d+)` extracts each value correctly.
1145
+ *
1146
+ * Format: `VS1234SS5678KS0308` (max 30 chars).
1139
1147
  * Confirmed by Finbricks support (2026-04-23).
1140
1148
  */
1141
1149
  buildEndToEndId(payment) {
1142
- return buildEndToEndId(payment, { separator: "-" });
1150
+ return buildEndToEndId(payment, { separator: "" });
1143
1151
  }
1144
1152
  }
1145
1153
 
package/dist/types.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const mock_connector = require('./shared/bank.C8oW81NT.cjs');
3
+ const mock_connector = require('./shared/bank.CQfKMyzc.cjs');
4
4
  const database_schema = require('./shared/bank.CIWYI18z.cjs');
5
5
  const batchLifecycle = require('./shared/bank.NF8bZBy0.cjs');
6
6
  const generalCodes = require('@develit-io/general-codes');
package/dist/types.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { 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 assignAccount, s as signFinbricksJws, t as toBatchedPayment, e as toBatchedPaymentFromPaymentRequest, f as toCompletedPayment, g as toIncomingPayment, h as toPaymentRequestInsert, i as toPreparedPayment, u as useFinbricksFetch } from './shared/bank.aSyaZEZI.mjs';
1
+ export { 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 assignAccount, s as signFinbricksJws, t as toBatchedPayment, e as toBatchedPaymentFromPaymentRequest, f as toCompletedPayment, g as toIncomingPayment, h as toPaymentRequestInsert, i as toPreparedPayment, u as useFinbricksFetch } from './shared/bank.CmgGdN-q.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, h as accountCredentialsInsertSchema, i as accountCredentialsSelectSchema, j as accountCredentialsUpdateSchema, k as accountInsertSchema, l as accountSelectSchema, m as accountUpdateSchema, n as hasPaymentAccountAssigned, o as isPaymentCompleted, p as isPendingStatus, q as isProcessedStatus, r as isTerminalStatus, s as ottInsertSchema, t as ottSelectSchema, u as ottUpdateSchema } from './shared/bank.C7MA33AX.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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/bank",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {