From 606be7577be2bd249f19204d0c80b3b48e3065ca Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 18 Feb 2022 16:54:15 -0300 Subject: some fixes -fix fulfillment messages -fix product list pricing and image on payment -filter exchange by currency on withdrawal -error message on operation error on withdrawal -add taler url on balance page (just for dev) -add no balance help -better text when doing manual withdraw for the firt time -removed balance from wallet (just history) -removed pending page --- packages/taler-wallet-webextension/src/cta/Pay.tsx | 69 ++++++++++++++++++---- 1 file changed, 56 insertions(+), 13 deletions(-) (limited to 'packages/taler-wallet-webextension/src/cta/Pay.tsx') diff --git a/packages/taler-wallet-webextension/src/cta/Pay.tsx b/packages/taler-wallet-webextension/src/cta/Pay.tsx index 806338c4d..7f5f42e8d 100644 --- a/packages/taler-wallet-webextension/src/cta/Pay.tsx +++ b/packages/taler-wallet-webextension/src/cta/Pay.tsx @@ -48,6 +48,7 @@ import { Part } from "../components/Part"; import { QR } from "../components/QR"; import { ButtonSuccess, + LightText, LinkSuccess, SmallLightText, SuccessBox, @@ -313,7 +314,9 @@ export function PaymentRequestView({

Payment complete

{!payResult.contractTerms.fulfillment_message - ? "You will now be sent back to the merchant you came from." + ? payResult.contractTerms.fulfillment_url + ? `You are going to be redirected to ${payResult.contractTerms.fulfillment_url}` + : "You can close this page." : payResult.contractTerms.fulfillment_message}

@@ -373,19 +376,59 @@ function ProductList({ products }: { products: Product[] }): VNode { List of products
- {products.map((p, i) => ( -
-
- -
-
-
{p.description}
-
- {p.price} x {p.quantity} {p.unit ? `(${p.unit})` : ``} -
+ {products.map((p, i) => { + if (p.price) { + const pPrice = Amounts.parseOrThrow(p.price); + return ( +
+
+ +
+
+
+ {p.quantity ?? 1} x {p.description}{" "} + + {Amounts.stringify(pPrice)} + +
+
+ + {Amounts.stringify( + Amounts.mult(pPrice, p.quantity ?? 1).amount, + )} + +
+
+
+ ); + } + return ( +
+
+ +
+
+
+ {p.quantity ?? 1} x {p.description} +
+
+ Total{` `} + {p.price + ? `${Amounts.stringifyValue( + Amounts.mult( + Amounts.parseOrThrow(p.price), + p.quantity ?? 1, + ).amount, + )} ${p}` + : "free"} +
+
-
- ))} + ); + })}
); -- cgit v1.2.3