diff options
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r-- | packages/taler-wallet-core/src/withdraw.ts | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts index b10c454f0..981c85ba4 100644 --- a/packages/taler-wallet-core/src/withdraw.ts +++ b/packages/taler-wallet-core/src/withdraw.ts @@ -3303,14 +3303,18 @@ export async function acceptWithdrawalFromUri( "amount required, as withdrawal operation has flexible amount", ); } - amount = req.amount as AmountString; + amount = Amounts.stringify(req.amount); } else { - if (req.amount != null && !p.info.editableAmount) { - throw Error( - `mismatched amount, amount is fixed by bank (${p.info.amount}) but client provided different amount (${req.amount})`, - ); + if (req.amount == null) { + amount = p.info.amount; + } else { + if (!p.info.editableAmount) { + throw Error( + `mismatched amount, amount is fixed by bank (${p.info.amount}) but client provided different amount (${req.amount})`, + ); + } + amount = Amounts.stringify(req.amount); } - amount = p.info.amount; } logger.info(`confirming withdrawal with tx ${p.transactionId}`); |