From e4c168b8c518c1d1efa63e8cfce349d0ca4a8d67 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 14 Jun 2024 14:37:36 -0300 Subject: fix #8930 --- .../src/pages/account/ShowAccountDetails.tsx | 186 ++++++++++++++------- 1 file changed, 122 insertions(+), 64 deletions(-) (limited to 'packages/bank-ui/src/pages') diff --git a/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx b/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx index 0e2144d77..2d6b88863 100644 --- a/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx +++ b/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx @@ -22,7 +22,7 @@ import { TalerErrorCode, TranslatedString, assertUnreachable, - parsePaytoUri + parsePaytoUri, } from "@gnu-taler/taler-util"; import { CopyButton, @@ -202,16 +202,18 @@ export function ShowAccountDetails({ const url = bank.getRevenueAPI(account); const baseURL = url.href; - const revenueURL = new URL(baseURL) + const revenueURL = new URL(baseURL); revenueURL.username = account; - revenueURL.password = creds?.token ?? "" + revenueURL.password; const ac = parsePaytoUri(result.body.payto_uri); const payto = !ac?.isKnown ? undefined : ac; - const accountLetter : AccountLetter | undefined = !payto + const accountLetter: AccountLetter | undefined = !payto ? undefined : { - accountURI: result.body.payto_uri, infoURL: revenueURL.href - } + accountURI: result.body.payto_uri, + infoURL: revenueURL.href, + accountToken: creds?.token, + }; return ( @@ -339,15 +341,21 @@ export function ShowAccountDetails({ {i18n.str`IBAN`}
- +
+ + payto.iban} + /> +

@@ -359,30 +367,70 @@ export function ShowAccountDetails({ } case "x-taler-bank": { return ( -

- -
- + +
+ +
+
+ +
+ payto.host} + /> +
+ +

+ + Bank host where the service is located. + +

-

- - Bank account identifier for wire transfers. - -

-
+
+ +
+
+ +
+ payto.account} + /> +
+ +

+ + Bank account identifier for wire transfers. + +

+
+ ); } case "bitcoin": { @@ -401,9 +449,13 @@ export function ShowAccountDetails({ name="iban" id="iban" disabled={true} - value={"DE1231231231"} + value={"asd"} autocomplete="off" /> + "Asd"} + />

@@ -424,15 +476,21 @@ export function ShowAccountDetails({ {i18n.str`Owner's name`}

- +
+ + result.body.name} + /> +

@@ -448,15 +506,21 @@ export function ShowAccountDetails({ {i18n.str`Account info URL`}

- +
+ + baseURL} + /> +

@@ -475,12 +539,7 @@ export function ShowAccountDetails({ > Cancel - !accountLetter ? "" : JSON.stringify(accountLetter)} - class="flex text-center disabled:opacity-50 disabled:cursor-default cursor-pointer rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600" - > - Copy - + )} @@ -488,4 +547,3 @@ export function ShowAccountDetails({ ); } - -- cgit v1.2.3