From c8553f3bc53064d157b56220e9d2333b8931e7a5 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 29 Jul 2020 23:10:41 +0530 Subject: tweaks to pay API --- src/webex/pages/pay.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/webex/pages/pay.tsx') diff --git a/src/webex/pages/pay.tsx b/src/webex/pages/pay.tsx index 87f3c83d3..d255ab6e5 100644 --- a/src/webex/pages/pay.tsx +++ b/src/webex/pages/pay.tsx @@ -39,7 +39,7 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }): JSX.Element { const [payErrMsg, setPayErrMsg] = useState(""); const [numTries, setNumTries] = useState(0); const [loading, setLoading] = useState(false); - let totalFees: Amounts.AmountJson | undefined = undefined; + let amountEffective: Amounts.AmountJson | undefined = undefined; useEffect(() => { const doFetch = async (): Promise => { @@ -59,7 +59,7 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }): JSX.Element { } if (payStatus.status === "payment-possible") { - totalFees = payStatus.totalFees; + amountEffective = Amounts.parseOrThrow(payStatus.amountEffective); } if (payStatus.status === PreparePayResultType.AlreadyConfirmed && numTries === 0) { @@ -75,13 +75,13 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }): JSX.Element { try { contractTerms = codecForContractTerms().decode( - JSON.parse(payStatus.contractTermsRaw), + JSON.parse(payStatus.contractTerms), ); } catch (e) { // This should never happen, as the wallet is supposed to check the contract terms // before storing them. console.error(e); - console.log("raw contract terms were", payStatus.contractTermsRaw); + console.log("raw contract terms were", payStatus.contractTerms); return Invalid contract terms.; } @@ -129,10 +129,10 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }): JSX.Element {
{contractTerms.summary}
- {totalFees ? ( + {amountEffective ? ( The total price is {amount} - (plus {renderAmount(totalFees)} fees). + (plus {renderAmount(amountEffective)} fees). ) : ( -- cgit v1.2.3