diff options
author | Florian Dold <florian@dold.me> | 2024-04-08 19:56:54 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-04-08 19:56:54 +0200 |
commit | 85b6213333b211bbfae9209630d8446108c4ce56 (patch) | |
tree | 90456a87b674a223e4565a0fc8ae6219703cb2ac /packages/taler-wallet-core/src/pay-merchant.ts | |
parent | 988911236823c0314f3c01ad219374c34ff21433 (diff) | |
download | wallet-core-85b6213333b211bbfae9209630d8446108c4ce56.tar.gz wallet-core-85b6213333b211bbfae9209630d8446108c4ce56.tar.bz2 wallet-core-85b6213333b211bbfae9209630d8446108c4ce56.zip |
wallet-core: refactor getTotalRefreshCost
Diffstat (limited to 'packages/taler-wallet-core/src/pay-merchant.ts')
-rw-r--r-- | packages/taler-wallet-core/src/pay-merchant.ts | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts index 5b4db4931..2a01481b0 100644 --- a/packages/taler-wallet-core/src/pay-merchant.ts +++ b/packages/taler-wallet-core/src/pay-merchant.ts @@ -143,7 +143,6 @@ import { getDenomInfo, WalletExecutionContext, } from "./wallet.js"; -import { getCandidateWithdrawalDenomsTx } from "./withdraw.js"; /** * Logger. @@ -468,18 +467,12 @@ export async function getTotalPaymentCost( "can't calculate payment cost, denomination for coin not found", ); } - const allDenoms = await getCandidateWithdrawalDenomsTx( + const amountLeft = Amounts.sub(denom.value, pcs[i].contribution).amount; + const refreshCost = await getTotalRefreshCost( wex, tx, - pcs[i].exchangeBaseUrl, - currency, - ); - const amountLeft = Amounts.sub(denom.value, pcs[i].contribution).amount; - const refreshCost = getTotalRefreshCost( - allDenoms, DenominationRecord.toDenomInfo(denom), amountLeft, - wex.ws.config.testing.denomselAllowLate, ); costs.push(Amounts.parseOrThrow(pcs[i].contribution)); costs.push(refreshCost); |