diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-07-29 23:10:41 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-07-29 23:10:41 +0530 |
commit | c8553f3bc53064d157b56220e9d2333b8931e7a5 (patch) | |
tree | 408159da65252498e7f676d54dbde3c2c3275c0b /src/webex/pages | |
parent | dfe5e95bc8537e13c482fff42cfefeb090eb2e09 (diff) | |
download | wallet-core-c8553f3bc53064d157b56220e9d2333b8931e7a5.tar.xz |
tweaks to pay APIv0.7.1-dev.13
Diffstat (limited to 'src/webex/pages')
-rw-r--r-- | src/webex/pages/pay.tsx | 12 |
1 files changed, 6 insertions, 6 deletions
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<string | undefined>(""); 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<void> => { @@ -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 <span>Invalid contract terms.</span>; } @@ -129,10 +129,10 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }): JSX.Element { <div style={{ textAlign: "center" }}> <strong>{contractTerms.summary}</strong> </div> - {totalFees ? ( + {amountEffective ? ( <i18n.Translate wrap="p"> The total price is <span>{amount} </span> - (plus <span>{renderAmount(totalFees)}</span> fees). + (plus <span>{renderAmount(amountEffective)}</span> fees). </i18n.Translate> ) : ( <i18n.Translate wrap="p"> |