summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/cta/Payment/views.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-01-20 15:44:53 -0300
committerSebastian <sebasjm@gmail.com>2023-01-20 15:45:02 -0300
commit03b12d2b27e9d4038e2b02b303a0401160ebc632 (patch)
tree2ea4f87a03ffc955ebeaf090d7ed6316c5c006f2 /packages/taler-wallet-webextension/src/cta/Payment/views.tsx
parent5f31dad2d3af80ab0f53cc52a8740f9a37ca0e75 (diff)
downloadwallet-core-03b12d2b27e9d4038e2b02b303a0401160ebc632.tar.gz
wallet-core-03b12d2b27e9d4038e2b02b303a0401160ebc632.tar.bz2
wallet-core-03b12d2b27e9d4038e2b02b303a0401160ebc632.zip
fix wrong fee calculation
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Payment/views.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/cta/Payment/views.tsx19
1 files changed, 10 insertions, 9 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Payment/views.tsx b/packages/taler-wallet-webextension/src/cta/Payment/views.tsx
index 244ac5886..53bc0c95f 100644
--- a/packages/taler-wallet-webextension/src/cta/Payment/views.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Payment/views.tsx
@@ -27,7 +27,11 @@ import { PaymentButtons } from "../../components/PaymentButtons.js";
import { SuccessBox, WarningBox } from "../../components/styled/index.js";
import { Time } from "../../components/Time.js";
import { useTranslationContext } from "../../context/translation.js";
-import { MerchantDetails, PurchaseDetails } from "../../wallet/Transaction.js";
+import {
+ getAmountWithFee,
+ MerchantDetails,
+ PurchaseDetails,
+} from "../../wallet/Transaction.js";
import { State } from "./index.js";
type SupportedStates =
@@ -41,13 +45,10 @@ export function BaseView(state: SupportedStates): VNode {
const contractTerms: ContractTerms = state.payStatus.contractTerms;
- const price = {
- raw: state.amount,
- effective:
- "amountEffective" in state.payStatus
- ? Amounts.parseOrThrow(state.payStatus.amountEffective)
- : state.amount,
- };
+ const effective =
+ "amountEffective" in state.payStatus
+ ? Amounts.parseOrThrow(state.payStatus.amountEffective)
+ : state.amount;
return (
<Fragment>
@@ -68,7 +69,7 @@ export function BaseView(state: SupportedStates): VNode {
title={i18n.str`Details`}
text={
<PurchaseDetails
- price={price}
+ price={getAmountWithFee(effective, state.amount, "debit")}
info={{
...contractTerms,
orderId: contractTerms.order_id,