summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/withdraw.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-02-20 02:19:41 +0100
committerFlorian Dold <florian@dold.me>2024-02-20 02:19:41 +0100
commitdf6f50028339c033982b94662e8ab465383095b3 (patch)
treef2963e5bee0dbe9552b0978ab59f7d384be5f64a /packages/taler-wallet-core/src/withdraw.ts
parent578bd4b1ed12049800556460359cb55a1e8545a2 (diff)
downloadwallet-core-df6f50028339c033982b94662e8ab465383095b3.tar.gz
wallet-core-df6f50028339c033982b94662e8ab465383095b3.tar.bz2
wallet-core-df6f50028339c033982b94662e8ab465383095b3.zip
wallet-core: count deposits towards pendingOutgoing
Diffstat (limited to 'packages/taler-wallet-core/src/withdraw.ts')
-rw-r--r--packages/taler-wallet-core/src/withdraw.ts16
1 files changed, 11 insertions, 5 deletions
diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts
index 3f4b3ef70..b34ad521d 100644
--- a/packages/taler-wallet-core/src/withdraw.ts
+++ b/packages/taler-wallet-core/src/withdraw.ts
@@ -1685,7 +1685,11 @@ export async function processWithdrawalGroup(
case WithdrawalGroupStatus.PendingQueryingStatus:
return processQueryReserve(ws, withdrawalGroupId, cancellationToken);
case WithdrawalGroupStatus.PendingWaitConfirmBank:
- return await processReserveBankStatus(ws, withdrawalGroupId);
+ return await processReserveBankStatus(
+ ws,
+ withdrawalGroupId,
+ cancellationToken,
+ );
case WithdrawalGroupStatus.PendingAml:
// FIXME: Handle this case, withdrawal doesn't support AML yet.
return TaskRunResult.backoff();
@@ -2233,6 +2237,7 @@ async function processBankRegisterReserve(
async function processReserveBankStatus(
ws: InternalWalletState,
withdrawalGroupId: string,
+ cancellationToken: CancellationToken,
): Promise<TaskRunResult> {
const withdrawalGroup = await getWithdrawalGroupRecordTx(ws.db, {
withdrawalGroupId,
@@ -2258,15 +2263,16 @@ async function processReserveBankStatus(
if (!uriResult) {
throw Error(`can't parse withdrawal URL ${bankInfo.talerWithdrawUri}`);
}
- const url = new URL(
+ const bankStatusUrl = new URL(
`withdrawal-operation/${uriResult.withdrawalOperationId}`,
uriResult.bankIntegrationApiBaseUrl,
);
- url.searchParams.set("long_poll_ms", "30000");
+ bankStatusUrl.searchParams.set("long_poll_ms", "30000");
- logger.info(`long-polling for withdrawal operation at ${url.href}`);
- const statusResp = await ws.http.fetch(url.href, {
+ logger.info(`long-polling for withdrawal operation at ${bankStatusUrl.href}`);
+ const statusResp = await ws.http.fetch(bankStatusUrl.href, {
timeout: getReserveRequestTimeout(withdrawalGroup),
+ cancellationToken,
});
logger.info(
`long-polling for withdrawal operation returned status ${statusResp.status}`,