summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/pay.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-07-12 15:55:31 +0200
committerFlorian Dold <florian@dold.me>2021-07-12 15:55:31 +0200
commit1c0cce3f5812cd2796ab9693b47f035427ca5340 (patch)
treed79c4953dd3947fb89c954df1daebfff1f734669 /packages/taler-wallet-core/src/operations/pay.ts
parent2667d741e92e82d3cea9512f7c0a7ae8c0b09f80 (diff)
downloadwallet-core-1c0cce3f5812cd2796ab9693b47f035427ca5340.tar.gz
wallet-core-1c0cce3f5812cd2796ab9693b47f035427ca5340.tar.bz2
wallet-core-1c0cce3f5812cd2796ab9693b47f035427ca5340.zip
tolerate zero-value payments
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/pay.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay.ts b/packages/taler-wallet-core/src/operations/pay.ts
index 33d3bc83c..fed61428c 100644
--- a/packages/taler-wallet-core/src/operations/pay.ts
+++ b/packages/taler-wallet-core/src/operations/pay.ts
@@ -145,7 +145,8 @@ export async function getTotalPaymentCost(
costs.push(pcs.coinContributions[i]);
costs.push(refreshCost);
}
- return Amounts.sum(costs).amount;
+ const zero = Amounts.getZero(pcs.paymentAmount.currency);
+ return Amounts.sum([zero, ...costs]).amount;
});
}