commit 57a6a98cacdd9c9864ee4029069c51c0b27381fd
parent 13affb117dd668c75028f3518972e87e52404cd0
Author: Sebastian <sebasjm@gmail.com>
Date: Mon, 29 Jul 2024 13:51:09 -0300
return confirm url on withdrawal confirmation
Diffstat:
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts
@@ -515,7 +515,7 @@ export type PrepareBankIntegratedWithdrawalOp = {
export type ConfirmWithdrawalOp = {
op: WalletApiOperation.ConfirmWithdrawal;
request: ConfirmWithdrawalRequest;
- response: EmptyObject;
+ response: AcceptWithdrawalResponse;
};
/**
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
@@ -1634,10 +1634,7 @@ const handlers: { [T in WalletApiOperation]: HandlerWithValidator<T> } = {
},
[WalletApiOperation.ConfirmWithdrawal]: {
codec: codecForConfirmWithdrawalRequestRequest(),
- handler: async (wex, req) => {
- await confirmWithdrawal(wex, req);
- return {};
- },
+ handler: confirmWithdrawal,
},
[WalletApiOperation.PrepareBankIntegratedWithdrawal]: {
codec: codecForPrepareBankIntegratedWithdrawalRequest(),
diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts
@@ -3220,7 +3220,7 @@ export async function prepareBankIntegratedWithdrawal(
export async function confirmWithdrawal(
wex: WalletExecutionContext,
req: ConfirmWithdrawalRequest,
-): Promise<void> {
+): Promise<AcceptWithdrawalResponse> {
const parsedTx = parseTransactionIdentifier(req.transactionId);
const selectedExchange = req.exchangeBaseUrl;
const instructedAmount = Amounts.parseOrThrow(req.amount);
@@ -3376,6 +3376,12 @@ export async function confirmWithdrawal(
"done waiting for withdrawal operation to be registered with bank",
});
}
+
+ return {
+ reservePub: withdrawalGroup.reservePub,
+ transactionId: req.transactionId as TransactionIdStr,
+ confirmTransferUrl: withdrawalGroup.wgInfo.bankInfo.confirmUrl,
+ }
}
/**