From d81a88343892bc00d8499733ea16968f9153295d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 1 Mar 2024 13:17:15 -0300 Subject: fix 8500 --- .../src/components/BankDetailsByPaytoType.tsx | 92 ++++++++---------- .../src/wallet/ReserveCreated.stories.tsx | 107 --------------------- .../src/wallet/ReserveCreated.tsx | 86 ----------------- .../src/wallet/Transaction.tsx | 39 ++++++-- .../src/wallet/index.stories.tsx | 1 - 5 files changed, 71 insertions(+), 254 deletions(-) delete mode 100644 packages/taler-wallet-webextension/src/wallet/ReserveCreated.stories.tsx delete mode 100644 packages/taler-wallet-webextension/src/wallet/ReserveCreated.tsx (limited to 'packages/taler-wallet-webextension') diff --git a/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx b/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx index 9fd117b08..631ffa5e9 100644 --- a/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx +++ b/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx @@ -46,7 +46,7 @@ export function BankDetailsByPaytoType({ }: BankDetailsProps): VNode { const { i18n } = useTranslationContext(); const [index, setIndex] = useState(0) - const [currency, setCurrency] = useState(amount.currency) + // const [currency, setCurrency] = useState(amount.currency) if (!accounts.length) { return
the exchange account list is empty
} @@ -56,7 +56,7 @@ export function BankDetailsByPaytoType({ const payto = parsePaytoUri(selectedAccount.paytoUri); if (!payto) return ; - payto.params["amount"] = currency === altCurrency ? selectedAccount.transferAmount! :Amounts.stringify(amount) ; + payto.params["amount"] = altCurrency ? selectedAccount.transferAmount! : Amounts.stringify(amount); payto.params["message"] = subject; @@ -73,35 +73,32 @@ export function BankDetailsByPaytoType({

{title}

- {accounts.length > 1 ? - - : undefined} +
+ +
{children} - {altCurrency ? + {accounts.length > 1 ? - - + })} + + {/* + */} : undefined} @@ -175,34 +172,37 @@ export function BankDetailsByPaytoType({
) : undefined; - const receiver = payto.params["receiver"] || undefined; + const receiver = payto.params["receiver-name"] || payto.params["receiver"] || undefined; return ( - {accountPart} - {currency === altCurrency ? - } - /> - } - /> + + {accountPart} + - : } + value={} /> - } - - {receiver ? ( - - ) : undefined} -
- - + + {receiver ? ( + + ) : undefined} + + + + +
+ + + + Make sure ALL data is correct including the subject, otherwise the money will not + arrive in this wallet. You can use the copy buttons () to prevent typing errors + or the "payto://" URI below to copy just one value. + + + +
@@ -227,14 +227,6 @@ export function BankDetailsByPaytoType({
           
-

- - - Make sure to use the correct subject, otherwise the money will not - arrive in this wallet. - - -

); } diff --git a/packages/taler-wallet-webextension/src/wallet/ReserveCreated.stories.tsx b/packages/taler-wallet-webextension/src/wallet/ReserveCreated.stories.tsx deleted file mode 100644 index 2fcf580ed..000000000 --- a/packages/taler-wallet-webextension/src/wallet/ReserveCreated.stories.tsx +++ /dev/null @@ -1,107 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2022 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see - */ - -/** - * - * @author Sebastian Javier Marchano (sebasjm) - */ - -import { parsePaytoUri } from "@gnu-taler/taler-util"; -import * as tests from "@gnu-taler/web-util/testing"; -import { ReserveCreated as TestedComponent } from "./ReserveCreated.js"; - -export default { - title: "reserve created", - component: TestedComponent, - argTypes: {}, -}; - -export const TalerBank = tests.createExample(TestedComponent, { - reservePub: "A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG", - paytoURI: parsePaytoUri( - "payto://x-taler-bank/bank.taler:5882/exchangeminator?amount=COL%3A1&message=Taler+Withdrawal+A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG", - ), - amount: { - currency: "USD", - value: 10, - fraction: 0, - }, - accounts: [] -}); - -export const IBAN = tests.createExample(TestedComponent, { - reservePub: "A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG", - paytoURI: parsePaytoUri( - "payto://iban/ES8877998399652238?amount=COL%3A1&message=Taler+Withdrawal+A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG", - ), - amount: { - currency: "USD", - value: 10, - fraction: 0, - }, - accounts: [] -}); - -export const WithReceiverName = tests.createExample(TestedComponent, { - reservePub: "A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG", - paytoURI: parsePaytoUri( - "payto://iban/ES8877998399652238?amount=COL%3A1&message=Taler+Withdrawal+A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG&receiver=Sebastian", - ), - amount: { - currency: "USD", - value: 10, - fraction: 0, - }, - accounts: [] -}); - -export const Bitcoin = tests.createExample(TestedComponent, { - reservePub: "0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00", - paytoURI: parsePaytoUri( - "payto://bitcoin/bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4?amount=BTC:0.1&subject=0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00", - ), - amount: { - currency: "BTC", - value: 0, - fraction: 14000000, - }, - accounts: [] -}); - -export const BitcoinRegTest = tests.createExample(TestedComponent, { - reservePub: "0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00", - paytoURI: parsePaytoUri( - "payto://bitcoin/bcrt1q6ps8qs6v8tkqrnru4xqqqa6rfwcx5ufpdfqht4?amount=BTC:0.1&subject=0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00", - ), - amount: { - currency: "BTC", - value: 0, - fraction: 14000000, - }, - accounts: [] -}); -export const BitcoinTest = tests.createExample(TestedComponent, { - reservePub: "0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00", - paytoURI: parsePaytoUri( - "payto://bitcoin/tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx?amount=BTC:0.1&subject=0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00", - ), - amount: { - currency: "BTC", - value: 0, - fraction: 14000000, - }, - accounts: [] -}); diff --git a/packages/taler-wallet-webextension/src/wallet/ReserveCreated.tsx b/packages/taler-wallet-webextension/src/wallet/ReserveCreated.tsx deleted file mode 100644 index 144413541..000000000 --- a/packages/taler-wallet-webextension/src/wallet/ReserveCreated.tsx +++ /dev/null @@ -1,86 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2022 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see - */ -import { AmountJson, PaytoUri, WithdrawalExchangeAccountDetails, stringifyPaytoUri } from "@gnu-taler/taler-util"; -import { Fragment, h, VNode } from "preact"; -import { Amount } from "../components/Amount.js"; -import { BankDetailsByPaytoType } from "../components/BankDetailsByPaytoType.js"; -import { CopyButton } from "../components/CopyButton.js"; -import { ErrorMessage } from "../components/ErrorMessage.js"; -import { QR } from "../components/QR.js"; -import { Title, WarningBox } from "../components/styled/index.js"; -import { useTranslationContext } from "@gnu-taler/web-util/browser"; -import { Button } from "../mui/Button.js"; -export interface Props { - reservePub: string; - paytoURI: PaytoUri | undefined; - accounts: WithdrawalExchangeAccountDetails[]; - amount: AmountJson; - onCancel: () => Promise; -} - -export function ReserveCreated({ - reservePub, - paytoURI, - onCancel, - accounts, - amount, -}: Props): VNode { - const { i18n } = useTranslationContext(); - if (!paytoURI) { - return ( - - ); - } - return ( - -
- - <i18n.Translate>Exchange is ready for withdrawal</i18n.Translate> - -

- - To complete the process you need to wire{` `} - {} to the exchange bank account - -

-
- -
-

- - Alternative, you can also scan this QR code or open{" "} - this link if you have a - banking app installed that supports RFC 8905 - -

- -
-
-
- -
-
- ); -} diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index 65ba6cc85..7363cca77 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -276,7 +276,7 @@ function TransactionTemplate({
This transaction is not completed - + + .withdrawalDetails.type === WithdrawalType.ManualTransfer + && transaction.withdrawalDetails.exchangeCreditAccountDetails ? ( + + + {transaction.withdrawalDetails.exchangeCreditAccountDetails.length > 1 ? + + + Now the payment service provider is waiting for to + be transferred. Select one of the account and use the information below + to complete the operation by making a wire transfer from your bank account. + + + : + + Now the payment service provider is waiting for to + be transferred. Use the information below to complete the operation + by making a wire transfer from your bank account. + } + + + + ) : ( //integrated bank withdrawal diff --git a/packages/taler-wallet-webextension/src/wallet/index.stories.tsx b/packages/taler-wallet-webextension/src/wallet/index.stories.tsx index 989292326..89bb75b29 100644 --- a/packages/taler-wallet-webextension/src/wallet/index.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/index.stories.tsx @@ -24,7 +24,6 @@ export * as a4 from "./DepositPage/stories.js"; export * as a7 from "./History.stories.js"; export * as a8 from "./AddBackupProvider/stories.js"; export * as a10 from "./ProviderDetail.stories.js"; -export * as a11 from "./ReserveCreated.stories.js"; export * as a12 from "./Settings.stories.js"; export * as a13 from "./Transaction.stories.js"; export * as a14 from "./Welcome.stories.js"; -- cgit v1.2.3