@develit-services/bank 0.8.1 → 0.8.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/README.md +82 -6
- package/dist/database/schema.cjs +9 -7
- 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/database/schema.mjs +1 -1
- package/dist/export/worker.cjs +211 -43
- package/dist/export/worker.d.cts +23 -8
- package/dist/export/worker.d.mts +23 -8
- package/dist/export/worker.d.ts +23 -8
- package/dist/export/worker.mjs +202 -34
- package/dist/export/workflows.cjs +71 -52
- package/dist/export/workflows.mjs +71 -52
- package/dist/export/wrangler.d.cts +1 -2
- package/dist/export/wrangler.d.mts +1 -2
- package/dist/export/wrangler.d.ts +1 -2
- package/dist/shared/{bank.C0p-hLzn.d.mts → bank.BE9bK1n7.d.mts} +213 -3
- package/dist/shared/{bank.Bs7mkXbR.cjs → bank.BOnP9p9Y.cjs} +15 -2
- package/dist/shared/bank.C-T1FQxg.cjs +17 -0
- package/dist/shared/{bank.993UA65l.mjs → bank.C4VOdIx1.mjs} +57 -5
- package/dist/shared/{bank.BC06Rbrx.d.cts → bank.CQBfbG8u.d.cts} +0 -1
- package/dist/shared/{bank.BC06Rbrx.d.mts → bank.CQBfbG8u.d.mts} +0 -1
- package/dist/shared/{bank.BC06Rbrx.d.ts → bank.CQBfbG8u.d.ts} +0 -1
- package/dist/shared/{bank.Ce-NBBw1.cjs → bank.CQURey1E.cjs} +64 -7
- package/dist/shared/{bank.CGIeLo8U.mjs → bank.Cpy9PULF.mjs} +14 -3
- package/dist/shared/bank.DDHrdFgy.mjs +15 -0
- package/dist/shared/{bank.BJ7LqYtJ.d.cts → bank.DDveEfub.d.cts} +707 -126
- package/dist/shared/{bank.BJ7LqYtJ.d.mts → bank.DDveEfub.d.mts} +707 -126
- package/dist/shared/{bank.BJ7LqYtJ.d.ts → bank.DDveEfub.d.ts} +707 -126
- package/dist/shared/{bank.CeRbuycV.mjs → bank.DRrBrAdI.mjs} +62 -8
- package/dist/shared/{bank.IVhZ_RlH.cjs → bank.SQ4Mmr8u.cjs} +57 -3
- package/dist/shared/{bank.C0p-hLzn.d.ts → bank.gl4dlxWy.d.cts} +213 -3
- package/dist/shared/{bank.C0p-hLzn.d.cts → bank.pngKIcOl.d.ts} +213 -3
- package/dist/types.cjs +25 -23
- package/dist/types.d.cts +29 -180
- package/dist/types.d.mts +29 -180
- package/dist/types.d.ts +29 -180
- package/dist/types.mjs +2 -2
- package/package.json +1 -1
- package/dist/shared/bank.Cp0yvOdq.cjs +0 -15
- package/dist/shared/bank.fIGTiPnp.mjs +0 -13
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
-
const drizzle = require('../shared/bank.
|
|
4
|
+
const drizzle = require('../shared/bank.BOnP9p9Y.cjs');
|
|
5
5
|
const batchLifecycle = require('../shared/bank.Bg3Pdwm4.cjs');
|
|
6
|
-
const mock_connector = require('../shared/bank.
|
|
6
|
+
const mock_connector = require('../shared/bank.CQURey1E.cjs');
|
|
7
7
|
const drizzleOrm = require('drizzle-orm');
|
|
8
8
|
const cloudflare_workers = require('cloudflare:workers');
|
|
9
9
|
const cloudflare_workflows = require('cloudflare:workflows');
|
|
10
10
|
const d1 = require('drizzle-orm/d1');
|
|
11
11
|
require('node:crypto');
|
|
12
|
-
require('../shared/bank.
|
|
12
|
+
require('../shared/bank.SQ4Mmr8u.cjs');
|
|
13
13
|
require('drizzle-orm/relations');
|
|
14
14
|
require('drizzle-orm/sqlite-core');
|
|
15
15
|
require('date-fns');
|
|
16
16
|
require('jose');
|
|
17
17
|
require('@develit-io/general-codes');
|
|
18
18
|
require('drizzle-zod');
|
|
19
|
-
require('../shared/bank.
|
|
19
|
+
require('../shared/bank.C-T1FQxg.cjs');
|
|
20
20
|
|
|
21
21
|
const updateAccountLastSyncCommand = (db, {
|
|
22
22
|
lastSyncAt,
|
|
@@ -54,8 +54,14 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
54
54
|
throw new cloudflare_workflows.NonRetryableError(`Batch already signed`);
|
|
55
55
|
return batch2;
|
|
56
56
|
});
|
|
57
|
+
const paymentRequests = await step.do("load payment requests", async () => {
|
|
58
|
+
return await drizzle.getPaymentRequestsByBatchIdQuery(db, { batchId });
|
|
59
|
+
});
|
|
60
|
+
if (paymentRequests.length === 0) {
|
|
61
|
+
throw new cloudflare_workflows.NonRetryableError("No payments found for batch");
|
|
62
|
+
}
|
|
57
63
|
await step.do("lock batch", async () => {
|
|
58
|
-
const paymentsChecksum = drizzle.checksum(
|
|
64
|
+
const paymentsChecksum = drizzle.checksum(paymentRequests);
|
|
59
65
|
if (batch.paymentsChecksum && batch.paymentsChecksum !== paymentsChecksum)
|
|
60
66
|
throw new cloudflare_workflows.NonRetryableError(
|
|
61
67
|
`Batch payments have been modified externally, manual review needed`
|
|
@@ -83,10 +89,13 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
83
89
|
timeout: "30 seconds"
|
|
84
90
|
},
|
|
85
91
|
async () => {
|
|
92
|
+
const batchedPayments = paymentRequests.map(
|
|
93
|
+
mock_connector.toBatchedPaymentFromPaymentRequest
|
|
94
|
+
);
|
|
86
95
|
if (batch.batchPaymentInitiatedAt) {
|
|
87
96
|
return {
|
|
88
97
|
authorizationUrls: batch.authorizationUrls,
|
|
89
|
-
preparedPayments:
|
|
98
|
+
preparedPayments: batchedPayments.map(
|
|
90
99
|
(p) => mock_connector.toPreparedPayment(p, void 0, batch.batchPaymentInitiatedAt)
|
|
91
100
|
),
|
|
92
101
|
metadata: batch.metadata
|
|
@@ -111,7 +120,7 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
111
120
|
]
|
|
112
121
|
});
|
|
113
122
|
const initiateBatchByType = () => {
|
|
114
|
-
const args = { batchId: batch.id, payments:
|
|
123
|
+
const args = { batchId: batch.id, payments: batchedPayments };
|
|
115
124
|
switch (batch.paymentType) {
|
|
116
125
|
case "SEPA":
|
|
117
126
|
return connector.initiateSEPABatch(args);
|
|
@@ -148,6 +157,23 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
148
157
|
};
|
|
149
158
|
}
|
|
150
159
|
);
|
|
160
|
+
await step.do("update payment requests to prepared", async () => {
|
|
161
|
+
const { preparedPayments, authorizationUrls } = batchResult;
|
|
162
|
+
const isPaymentRequestFallback = authorizationUrls.length === preparedPayments.length;
|
|
163
|
+
const updateCommands = preparedPayments.map(
|
|
164
|
+
(pp, i) => drizzle.updatePaymentRequestStatusCommand(db, {
|
|
165
|
+
id: pp.id,
|
|
166
|
+
status: "PREPARED",
|
|
167
|
+
bankRefId: pp.bankRefId,
|
|
168
|
+
initiatedAt: pp.initiatedAt,
|
|
169
|
+
authorizationUrl: isPaymentRequestFallback ? authorizationUrls[i] : authorizationUrls[0]
|
|
170
|
+
}).command
|
|
171
|
+
);
|
|
172
|
+
if (updateCommands.length > 0) {
|
|
173
|
+
await db.batch(updateCommands);
|
|
174
|
+
}
|
|
175
|
+
return { updated: updateCommands.length };
|
|
176
|
+
});
|
|
151
177
|
await step.do("update batch to ready to sign", async () => {
|
|
152
178
|
const upsertBatch = drizzle.upsertBatchCommand(db, {
|
|
153
179
|
batch: {
|
|
@@ -168,52 +194,45 @@ class BankProcessBatch extends cloudflare_workers.WorkflowEntrypoint {
|
|
|
168
194
|
(p) => p.connectorKey === "MOCK"
|
|
169
195
|
);
|
|
170
196
|
if (isMockConnector) {
|
|
171
|
-
await step.do(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
}).command;
|
|
190
|
-
if (createCommands.length > 0) {
|
|
191
|
-
await db.batch([updateBatchCommand, ...createCommands]);
|
|
192
|
-
} else {
|
|
193
|
-
await updateBatchCommand.execute();
|
|
197
|
+
await step.do("mock: complete payments and update batch", async () => {
|
|
198
|
+
const processedAt = /* @__PURE__ */ new Date();
|
|
199
|
+
const updateCommands = batchResult.preparedPayments.map(
|
|
200
|
+
(p) => drizzle.updatePaymentRequestStatusCommand(db, {
|
|
201
|
+
id: p.id,
|
|
202
|
+
status: "COMPLETED",
|
|
203
|
+
bankRefId: `MOCK-${backendSdk.uuidv4()}`,
|
|
204
|
+
processedAt
|
|
205
|
+
}).command
|
|
206
|
+
);
|
|
207
|
+
const updateBatchCommand = drizzle.upsertBatchCommand(db, {
|
|
208
|
+
batch: {
|
|
209
|
+
...batch,
|
|
210
|
+
status: "SIGNED",
|
|
211
|
+
authorizationUrls: batchResult.authorizationUrls,
|
|
212
|
+
metadata: batchResult.metadata,
|
|
213
|
+
batchPaymentInitiatedAt: /* @__PURE__ */ new Date()
|
|
194
214
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
);
|
|
215
|
+
}).command;
|
|
216
|
+
await db.batch([updateBatchCommand, ...updateCommands]);
|
|
217
|
+
const eventsToEmit = batchResult.preparedPayments.map((payment) => ({
|
|
218
|
+
eventType: "BANK_PAYMENT",
|
|
219
|
+
eventSignal: "paymentCompleted",
|
|
220
|
+
bankPayment: payment,
|
|
221
|
+
metadata: {
|
|
222
|
+
correlationId: backendSdk.uuidv4(),
|
|
223
|
+
entityId: payment.id,
|
|
224
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
225
|
+
}
|
|
226
|
+
}));
|
|
227
|
+
await pushToQueue$1(
|
|
228
|
+
this.env.QUEUE_BUS_QUEUE,
|
|
229
|
+
eventsToEmit
|
|
230
|
+
);
|
|
231
|
+
return {
|
|
232
|
+
paymentsCompleted: updateCommands.length,
|
|
233
|
+
eventsEmitted: eventsToEmit.length
|
|
234
|
+
};
|
|
235
|
+
});
|
|
217
236
|
}
|
|
218
237
|
if (!isMockConnector) {
|
|
219
238
|
await step.do("enqueue authorization email", async () => {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { first, uuidv4, asNonEmpty } from '@develit-io/backend-sdk';
|
|
2
|
-
import { t as tables, g as getBatchByIdQuery, c as checksum, u as upsertBatchCommand,
|
|
2
|
+
import { t as tables, 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.Cpy9PULF.mjs';
|
|
3
3
|
import { f as isBatchSigned, a as isBatchFailed, c as isBatchOpen, g as isPaymentCompleted } from '../shared/bank.CbAwwIhZ.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { f as toBatchedPaymentFromPaymentRequest, j as toPreparedPayment, k as initiateConnector } from '../shared/bank.DRrBrAdI.mjs';
|
|
5
5
|
import { eq } from 'drizzle-orm';
|
|
6
6
|
import { WorkflowEntrypoint } from 'cloudflare:workers';
|
|
7
7
|
import { NonRetryableError } from 'cloudflare:workflows';
|
|
8
8
|
import { drizzle } from 'drizzle-orm/d1';
|
|
9
9
|
import 'node:crypto';
|
|
10
|
-
import '../shared/bank.
|
|
10
|
+
import '../shared/bank.C4VOdIx1.mjs';
|
|
11
11
|
import 'drizzle-orm/relations';
|
|
12
12
|
import 'drizzle-orm/sqlite-core';
|
|
13
13
|
import 'date-fns';
|
|
14
14
|
import 'jose';
|
|
15
15
|
import '@develit-io/general-codes';
|
|
16
16
|
import 'drizzle-zod';
|
|
17
|
-
import '../shared/bank.
|
|
17
|
+
import '../shared/bank.DDHrdFgy.mjs';
|
|
18
18
|
|
|
19
19
|
const updateAccountLastSyncCommand = (db, {
|
|
20
20
|
lastSyncAt,
|
|
@@ -52,8 +52,14 @@ class BankProcessBatch extends WorkflowEntrypoint {
|
|
|
52
52
|
throw new NonRetryableError(`Batch already signed`);
|
|
53
53
|
return batch2;
|
|
54
54
|
});
|
|
55
|
+
const paymentRequests = await step.do("load payment requests", async () => {
|
|
56
|
+
return await getPaymentRequestsByBatchIdQuery(db, { batchId });
|
|
57
|
+
});
|
|
58
|
+
if (paymentRequests.length === 0) {
|
|
59
|
+
throw new NonRetryableError("No payments found for batch");
|
|
60
|
+
}
|
|
55
61
|
await step.do("lock batch", async () => {
|
|
56
|
-
const paymentsChecksum = checksum(
|
|
62
|
+
const paymentsChecksum = checksum(paymentRequests);
|
|
57
63
|
if (batch.paymentsChecksum && batch.paymentsChecksum !== paymentsChecksum)
|
|
58
64
|
throw new NonRetryableError(
|
|
59
65
|
`Batch payments have been modified externally, manual review needed`
|
|
@@ -81,10 +87,13 @@ class BankProcessBatch extends WorkflowEntrypoint {
|
|
|
81
87
|
timeout: "30 seconds"
|
|
82
88
|
},
|
|
83
89
|
async () => {
|
|
90
|
+
const batchedPayments = paymentRequests.map(
|
|
91
|
+
toBatchedPaymentFromPaymentRequest
|
|
92
|
+
);
|
|
84
93
|
if (batch.batchPaymentInitiatedAt) {
|
|
85
94
|
return {
|
|
86
95
|
authorizationUrls: batch.authorizationUrls,
|
|
87
|
-
preparedPayments:
|
|
96
|
+
preparedPayments: batchedPayments.map(
|
|
88
97
|
(p) => toPreparedPayment(p, void 0, batch.batchPaymentInitiatedAt)
|
|
89
98
|
),
|
|
90
99
|
metadata: batch.metadata
|
|
@@ -109,7 +118,7 @@ class BankProcessBatch extends WorkflowEntrypoint {
|
|
|
109
118
|
]
|
|
110
119
|
});
|
|
111
120
|
const initiateBatchByType = () => {
|
|
112
|
-
const args = { batchId: batch.id, payments:
|
|
121
|
+
const args = { batchId: batch.id, payments: batchedPayments };
|
|
113
122
|
switch (batch.paymentType) {
|
|
114
123
|
case "SEPA":
|
|
115
124
|
return connector.initiateSEPABatch(args);
|
|
@@ -146,6 +155,23 @@ class BankProcessBatch extends WorkflowEntrypoint {
|
|
|
146
155
|
};
|
|
147
156
|
}
|
|
148
157
|
);
|
|
158
|
+
await step.do("update payment requests to prepared", async () => {
|
|
159
|
+
const { preparedPayments, authorizationUrls } = batchResult;
|
|
160
|
+
const isPaymentRequestFallback = authorizationUrls.length === preparedPayments.length;
|
|
161
|
+
const updateCommands = preparedPayments.map(
|
|
162
|
+
(pp, i) => updatePaymentRequestStatusCommand(db, {
|
|
163
|
+
id: pp.id,
|
|
164
|
+
status: "PREPARED",
|
|
165
|
+
bankRefId: pp.bankRefId,
|
|
166
|
+
initiatedAt: pp.initiatedAt,
|
|
167
|
+
authorizationUrl: isPaymentRequestFallback ? authorizationUrls[i] : authorizationUrls[0]
|
|
168
|
+
}).command
|
|
169
|
+
);
|
|
170
|
+
if (updateCommands.length > 0) {
|
|
171
|
+
await db.batch(updateCommands);
|
|
172
|
+
}
|
|
173
|
+
return { updated: updateCommands.length };
|
|
174
|
+
});
|
|
149
175
|
await step.do("update batch to ready to sign", async () => {
|
|
150
176
|
const upsertBatch = upsertBatchCommand(db, {
|
|
151
177
|
batch: {
|
|
@@ -166,52 +192,45 @@ class BankProcessBatch extends WorkflowEntrypoint {
|
|
|
166
192
|
(p) => p.connectorKey === "MOCK"
|
|
167
193
|
);
|
|
168
194
|
if (isMockConnector) {
|
|
169
|
-
await step.do(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
}).command;
|
|
188
|
-
if (createCommands.length > 0) {
|
|
189
|
-
await db.batch([updateBatchCommand, ...createCommands]);
|
|
190
|
-
} else {
|
|
191
|
-
await updateBatchCommand.execute();
|
|
195
|
+
await step.do("mock: complete payments and update batch", async () => {
|
|
196
|
+
const processedAt = /* @__PURE__ */ new Date();
|
|
197
|
+
const updateCommands = batchResult.preparedPayments.map(
|
|
198
|
+
(p) => updatePaymentRequestStatusCommand(db, {
|
|
199
|
+
id: p.id,
|
|
200
|
+
status: "COMPLETED",
|
|
201
|
+
bankRefId: `MOCK-${uuidv4()}`,
|
|
202
|
+
processedAt
|
|
203
|
+
}).command
|
|
204
|
+
);
|
|
205
|
+
const updateBatchCommand = upsertBatchCommand(db, {
|
|
206
|
+
batch: {
|
|
207
|
+
...batch,
|
|
208
|
+
status: "SIGNED",
|
|
209
|
+
authorizationUrls: batchResult.authorizationUrls,
|
|
210
|
+
metadata: batchResult.metadata,
|
|
211
|
+
batchPaymentInitiatedAt: /* @__PURE__ */ new Date()
|
|
192
212
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
);
|
|
213
|
+
}).command;
|
|
214
|
+
await db.batch([updateBatchCommand, ...updateCommands]);
|
|
215
|
+
const eventsToEmit = batchResult.preparedPayments.map((payment) => ({
|
|
216
|
+
eventType: "BANK_PAYMENT",
|
|
217
|
+
eventSignal: "paymentCompleted",
|
|
218
|
+
bankPayment: payment,
|
|
219
|
+
metadata: {
|
|
220
|
+
correlationId: uuidv4(),
|
|
221
|
+
entityId: payment.id,
|
|
222
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
223
|
+
}
|
|
224
|
+
}));
|
|
225
|
+
await pushToQueue$1(
|
|
226
|
+
this.env.QUEUE_BUS_QUEUE,
|
|
227
|
+
eventsToEmit
|
|
228
|
+
);
|
|
229
|
+
return {
|
|
230
|
+
paymentsCompleted: updateCommands.length,
|
|
231
|
+
eventsEmitted: eventsToEmit.length
|
|
232
|
+
};
|
|
233
|
+
});
|
|
215
234
|
}
|
|
216
235
|
if (!isMockConnector) {
|
|
217
236
|
await step.do("enqueue authorization email", async () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BankServiceWranglerConfig } from '../shared/bank.
|
|
1
|
+
import { B as BankServiceWranglerConfig } from '../shared/bank.CQBfbG8u.cjs';
|
|
2
2
|
|
|
3
3
|
declare function defineBankServiceWrangler(config: BankServiceWranglerConfig): {
|
|
4
4
|
vars: {
|
|
@@ -9,7 +9,6 @@ declare function defineBankServiceWrangler(config: BankServiceWranglerConfig): {
|
|
|
9
9
|
FINBRICKS_BASE_URI: "https://api.sandbox.finbricks.com";
|
|
10
10
|
FINBRICKS_MERCHANT_ID: string;
|
|
11
11
|
CRON_BATCH_STATUSES: string;
|
|
12
|
-
CRON_PAYMENTS_PROCESSING: string;
|
|
13
12
|
BANK_AUTH_RECIPIENT: string;
|
|
14
13
|
DBUCS_BASE_URI: string;
|
|
15
14
|
DBUCS_USERNAME: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BankServiceWranglerConfig } from '../shared/bank.
|
|
1
|
+
import { B as BankServiceWranglerConfig } from '../shared/bank.CQBfbG8u.mjs';
|
|
2
2
|
|
|
3
3
|
declare function defineBankServiceWrangler(config: BankServiceWranglerConfig): {
|
|
4
4
|
vars: {
|
|
@@ -9,7 +9,6 @@ declare function defineBankServiceWrangler(config: BankServiceWranglerConfig): {
|
|
|
9
9
|
FINBRICKS_BASE_URI: "https://api.sandbox.finbricks.com";
|
|
10
10
|
FINBRICKS_MERCHANT_ID: string;
|
|
11
11
|
CRON_BATCH_STATUSES: string;
|
|
12
|
-
CRON_PAYMENTS_PROCESSING: string;
|
|
13
12
|
BANK_AUTH_RECIPIENT: string;
|
|
14
13
|
DBUCS_BASE_URI: string;
|
|
15
14
|
DBUCS_USERNAME: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BankServiceWranglerConfig } from '../shared/bank.
|
|
1
|
+
import { B as BankServiceWranglerConfig } from '../shared/bank.CQBfbG8u.js';
|
|
2
2
|
|
|
3
3
|
declare function defineBankServiceWrangler(config: BankServiceWranglerConfig): {
|
|
4
4
|
vars: {
|
|
@@ -9,7 +9,6 @@ declare function defineBankServiceWrangler(config: BankServiceWranglerConfig): {
|
|
|
9
9
|
FINBRICKS_BASE_URI: "https://api.sandbox.finbricks.com";
|
|
10
10
|
FINBRICKS_MERCHANT_ID: string;
|
|
11
11
|
CRON_BATCH_STATUSES: string;
|
|
12
|
-
CRON_PAYMENTS_PROCESSING: string;
|
|
13
12
|
BANK_AUTH_RECIPIENT: string;
|
|
14
13
|
DBUCS_BASE_URI: string;
|
|
15
14
|
DBUCS_USERNAME: string;
|
|
@@ -1,8 +1,218 @@
|
|
|
1
|
+
import { X as CurrencyCode, H as BankCode, U as CountryCode } from './bank.DDveEfub.mjs';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
|
|
4
|
+
type ReferenceType = `${'VS' | 'SS' | 'KS'}:${number}`;
|
|
5
|
+
|
|
6
|
+
type FinbricksAuthTokenResponse = {
|
|
7
|
+
clientId: string;
|
|
8
|
+
provider: string;
|
|
9
|
+
scope: 'AISP' | 'AISP_PISP';
|
|
10
|
+
validFrom: string;
|
|
11
|
+
validTo: string;
|
|
12
|
+
stronglyAuthenticatedTo?: string;
|
|
13
|
+
}[];
|
|
14
|
+
type RedirectUrl = {
|
|
15
|
+
redirectUrl: string;
|
|
16
|
+
};
|
|
17
|
+
type FinbricksIdentification = {
|
|
18
|
+
accountNumber: string;
|
|
19
|
+
iban: string;
|
|
20
|
+
other: {
|
|
21
|
+
type: string;
|
|
22
|
+
value: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type FinbricksServicer = {
|
|
26
|
+
bankCode: BankCode;
|
|
27
|
+
countryCode: CountryCode;
|
|
28
|
+
bic: string;
|
|
29
|
+
};
|
|
30
|
+
type FinbricksAccount = {
|
|
31
|
+
id: string;
|
|
32
|
+
identification: FinbricksIdentification;
|
|
33
|
+
currency: CurrencyCode;
|
|
34
|
+
servicer: FinbricksServicer;
|
|
35
|
+
accountName: string;
|
|
36
|
+
productName: string;
|
|
37
|
+
ownersNames: string[];
|
|
38
|
+
relationship: {
|
|
39
|
+
isOwner: boolean;
|
|
40
|
+
};
|
|
41
|
+
pispSuitable: boolean;
|
|
42
|
+
};
|
|
43
|
+
type FinbricksPaymentResponse = RedirectUrl;
|
|
44
|
+
type FinbricksBatchResponse = RedirectUrl;
|
|
45
|
+
type FinbricksConnectAccountResponse = RedirectUrl;
|
|
46
|
+
type FinbricksAccountsListResponse = {
|
|
47
|
+
accounts: FinbricksAccount[];
|
|
48
|
+
};
|
|
49
|
+
type FinbricksTransactionLink = {
|
|
50
|
+
rel: string;
|
|
51
|
+
value: string;
|
|
52
|
+
};
|
|
53
|
+
type FinbricksAmount = {
|
|
54
|
+
value: number;
|
|
55
|
+
currency: CurrencyCode;
|
|
56
|
+
};
|
|
57
|
+
type FinbricksAddress = {
|
|
58
|
+
streetName: string;
|
|
59
|
+
buildingNumber: string;
|
|
60
|
+
postCode: string;
|
|
61
|
+
townName: string;
|
|
62
|
+
country: CountryCode;
|
|
63
|
+
adressLine: string;
|
|
64
|
+
};
|
|
65
|
+
type FinbricksTransaction = {
|
|
66
|
+
fbxReference: string;
|
|
67
|
+
entryReference: string;
|
|
68
|
+
amount: FinbricksAmount;
|
|
69
|
+
creditDebitIndicator: 'CRDT' | 'DBIT';
|
|
70
|
+
reversalIndicator: boolean;
|
|
71
|
+
status: string;
|
|
72
|
+
bookingDate: {
|
|
73
|
+
date: Date;
|
|
74
|
+
};
|
|
75
|
+
valueDate: {
|
|
76
|
+
date: Date;
|
|
77
|
+
};
|
|
78
|
+
bankTransactionCode: {
|
|
79
|
+
proprietary: {
|
|
80
|
+
code: string;
|
|
81
|
+
issuer: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
entryDetails: {
|
|
85
|
+
transactionDetails: {
|
|
86
|
+
references: {
|
|
87
|
+
messageIdentification: string;
|
|
88
|
+
accountServicerReference: string;
|
|
89
|
+
paymentInformationIdentification: string;
|
|
90
|
+
instructionIdentification: string;
|
|
91
|
+
endToEndIdentification: string;
|
|
92
|
+
chequeNumber: string;
|
|
93
|
+
clearingSystemReference: string;
|
|
94
|
+
};
|
|
95
|
+
amountDetails: {
|
|
96
|
+
instructedAmount: {
|
|
97
|
+
amount: FinbricksAmount;
|
|
98
|
+
};
|
|
99
|
+
transactionAmount: {
|
|
100
|
+
amount: FinbricksAmount;
|
|
101
|
+
};
|
|
102
|
+
counterValueAmount: {
|
|
103
|
+
amount: FinbricksAmount;
|
|
104
|
+
currencyExchange: {
|
|
105
|
+
sourceCurrency: CurrencyCode;
|
|
106
|
+
targetCurrency: CurrencyCode;
|
|
107
|
+
exchangeRate: number;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
proprietaryAmount: {
|
|
111
|
+
type: string;
|
|
112
|
+
amount: FinbricksAmount;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
charges: {
|
|
116
|
+
bearer: string;
|
|
117
|
+
value: number;
|
|
118
|
+
currency: CurrencyCode;
|
|
119
|
+
};
|
|
120
|
+
relatedParties: {
|
|
121
|
+
debtor?: {
|
|
122
|
+
name: string;
|
|
123
|
+
postalAddress: FinbricksAddress;
|
|
124
|
+
identification: {
|
|
125
|
+
organizationIdentification: {
|
|
126
|
+
bicOrBei: string;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
debtorAccount?: {
|
|
131
|
+
name: string;
|
|
132
|
+
identification: {
|
|
133
|
+
iban: string;
|
|
134
|
+
other: {
|
|
135
|
+
identification: string;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
creditor?: {
|
|
140
|
+
name: string;
|
|
141
|
+
postalAddress: FinbricksAddress;
|
|
142
|
+
identification: {
|
|
143
|
+
organizationIdentification: {
|
|
144
|
+
bicOrBei: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
creditorAccount?: {
|
|
149
|
+
name: string;
|
|
150
|
+
identification: {
|
|
151
|
+
iban: string;
|
|
152
|
+
other: {
|
|
153
|
+
identification: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
remittanceInformation: {
|
|
159
|
+
unstructured: string;
|
|
160
|
+
structured: {
|
|
161
|
+
creditorReferenceInformation: {
|
|
162
|
+
reference: ReferenceType[];
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
additionalRemittanceInformation: string;
|
|
167
|
+
additionalTransactionInformation: string;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
type FinbricksSupportedBank = {
|
|
172
|
+
bankName: string;
|
|
173
|
+
paymentProvider: string;
|
|
174
|
+
bankCode?: string;
|
|
175
|
+
countryCode: string;
|
|
176
|
+
bic?: string;
|
|
177
|
+
enabledForMerchant: boolean;
|
|
178
|
+
/** @deprecated use supportedInstantPayments.domesticCreditor */
|
|
179
|
+
domesticInstantPaymentCreditorSupported: boolean;
|
|
180
|
+
/** @deprecated use supportedInstantPayments.domesticDebtor */
|
|
181
|
+
domesticInstantPaymentDebtorSupported: boolean;
|
|
182
|
+
/** @deprecated use supportedInstantPayments.sepaDebtor */
|
|
183
|
+
sepaInstantPaymentDebtorSupported: boolean;
|
|
184
|
+
/** @deprecated use supportedInstantPayments.sepaCreditor */
|
|
185
|
+
sepaInstantPaymentCreditorSupported: boolean;
|
|
186
|
+
logoUrl?: string;
|
|
187
|
+
supportedServices: {
|
|
188
|
+
domesticPayment: boolean;
|
|
189
|
+
sepaPayment: boolean;
|
|
190
|
+
foreignPayment: boolean;
|
|
191
|
+
accountInformation: boolean;
|
|
192
|
+
accountBalance: boolean;
|
|
193
|
+
accountTransactions: boolean;
|
|
194
|
+
batchPayment: boolean;
|
|
195
|
+
recurringPayment: boolean;
|
|
196
|
+
paymentPairing: boolean;
|
|
197
|
+
statusSettled: boolean;
|
|
198
|
+
};
|
|
199
|
+
supportedInstantPayments: {
|
|
200
|
+
domesticCreditor: boolean;
|
|
201
|
+
domesticDebtor: boolean;
|
|
202
|
+
sepaCreditor: boolean;
|
|
203
|
+
sepaDebtor: boolean;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
type FinbricksSupportedBanksResponse = FinbricksSupportedBank[];
|
|
207
|
+
type FinbricksAccountTransactionsResponse = {
|
|
208
|
+
pageSize: number;
|
|
209
|
+
links: FinbricksTransactionLink[];
|
|
210
|
+
transactions: FinbricksTransaction[];
|
|
211
|
+
};
|
|
212
|
+
|
|
3
213
|
declare const sendPaymentInputSchema: z.ZodObject<{
|
|
4
214
|
correlationId: z.ZodString;
|
|
5
|
-
refId: z.ZodString
|
|
215
|
+
refId: z.ZodOptional<z.ZodString>;
|
|
6
216
|
amount: z.ZodNumber;
|
|
7
217
|
paymentType: z.ZodEnum<{
|
|
8
218
|
SEPA: "SEPA";
|
|
@@ -749,7 +959,7 @@ type SendPaymentOutput = void;
|
|
|
749
959
|
|
|
750
960
|
declare const sendPaymentSyncInputSchema: z.ZodObject<{
|
|
751
961
|
correlationId: z.ZodString;
|
|
752
|
-
refId: z.ZodString
|
|
962
|
+
refId: z.ZodOptional<z.ZodString>;
|
|
753
963
|
amount: z.ZodNumber;
|
|
754
964
|
paymentType: z.ZodEnum<{
|
|
755
965
|
SEPA: "SEPA";
|
|
@@ -1497,4 +1707,4 @@ type SendPaymentSyncOutput = {
|
|
|
1497
1707
|
authorizationUrl: string;
|
|
1498
1708
|
};
|
|
1499
1709
|
|
|
1500
|
-
export type { SendPaymentInput as S, SendPaymentOutput as a, SendPaymentSyncInput as b, SendPaymentSyncOutput as c };
|
|
1710
|
+
export type { FinbricksSupportedBanksResponse as F, ReferenceType as R, SendPaymentInput as S, SendPaymentOutput as a, SendPaymentSyncInput as b, SendPaymentSyncOutput as c, FinbricksAccount as d, FinbricksAccountTransactionsResponse as e, FinbricksAccountsListResponse as f, FinbricksAuthTokenResponse as g, FinbricksBatchResponse as h, FinbricksConnectAccountResponse as i, FinbricksPaymentResponse as j, FinbricksSupportedBank as k };
|