diff options
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r-- | packages/taler-wallet-core/src/operations/withdraw.ts | 4 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 15 |
2 files changed, 18 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index f972d3cb1..a56a1a100 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -972,6 +972,10 @@ async function processPlanchetExchangeBatchRequest( responses.ev_sigs.push(r); responseCoinIdxs.push(requestCoinIdxs[i]); } catch (e) { + if (e instanceof TalerError) { + logger.warn(`withdrawing planchet failed: ${j2s(e.errorDetail)}`); + logger.warn(`planchet denom pub hash: ${batchReq.planchets[i].denom_pub_hash}`); + } await storeCoinError(e, requestCoinIdxs[i]); } } diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index ca86cbb14..e457ba003 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -1260,7 +1260,20 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( } case WalletApiOperation.ConfirmPay: { const req = codecForConfirmPayRequest().decode(payload); - return await confirmPay(ws, req.proposalId, req.sessionId); + let proposalId; + if (req.proposalId) { + // legacy client support + proposalId = req.proposalId; + } else if (req.transactionId) { + const txIdParsed = parseTransactionIdentifier(req.transactionId); + if (txIdParsed?.tag != TransactionType.Payment) { + throw Error("payment transaction ID required"); + } + proposalId = txIdParsed.proposalId; + } else { + throw Error("transactionId or (deprecated) proposalId required"); + } + return await confirmPay(ws, proposalId, req.sessionId); } case WalletApiOperation.AbortTransaction: { const req = codecForAbortTransaction().decode(payload); |