diff options
Diffstat (limited to 'packages/taler-wallet-webextension')
19 files changed, 302 insertions, 215 deletions
diff --git a/packages/taler-wallet-webextension/manifest-common.json b/packages/taler-wallet-webextension/manifest-common.json index 431cfa8a9..83c0bda1a 100644 --- a/packages/taler-wallet-webextension/manifest-common.json +++ b/packages/taler-wallet-webextension/manifest-common.json @@ -2,7 +2,7 @@ "name": "GNU Taler Wallet (git)", "description": "Privacy preserving and transparent payments", "author": "GNU Taler Developers", - "version": "0.13.4", + "version": "0.13.11", "icons": { "16": "static/img/taler-logo-16.png", "19": "static/img/taler-logo-19.png", @@ -14,5 +14,5 @@ "256": "static/img/taler-logo-256.png", "512": "static/img/taler-logo-512.png" }, - "version_name": "0.13.4" + "version_name": "0.13.11" } diff --git a/packages/taler-wallet-webextension/package.json b/packages/taler-wallet-webextension/package.json index 623556099..9c8adf1c1 100644 --- a/packages/taler-wallet-webextension/package.json +++ b/packages/taler-wallet-webextension/package.json @@ -1,6 +1,6 @@ { "name": "@gnu-taler/taler-wallet-webextension", - "version": "0.13.4", + "version": "0.13.11", "description": "GNU Taler Wallet browser extension", "main": "./build/index.js", "types": "./build/index.d.ts", diff --git a/packages/taler-wallet-webextension/src/NavigationBar.tsx b/packages/taler-wallet-webextension/src/NavigationBar.tsx index 66d47c180..7fb8dad8b 100644 --- a/packages/taler-wallet-webextension/src/NavigationBar.tsx +++ b/packages/taler-wallet-webextension/src/NavigationBar.tsx @@ -173,10 +173,11 @@ export const Pages = { ctaInvoicePay: "/cta/invoice/pay", ctaTransferPickup: "/cta/transfer/pickup", - ctaWithdrawManual: pageDefinition<{ + ctaWithdrawManualForScope: pageDefinition<{ scope: CrockEncodedString; amount?: string; - }>("/cta/manual-withdraw/:scope/:amount?"), + }>("/cta/scope-withdraw/:scope/:amount?"), + ctaWithdrawManual: pageDefinition<{amount?: string;}>("/cta/manual-withdraw/:amount?"), paytoQrs: pageDefinition<{ payto: CrockEncodedString }>("/payto/qrs/:payto?"), paytoBanks: pageDefinition<{ payto: CrockEncodedString }>( "/payto/banks/:payto?", diff --git a/packages/taler-wallet-webextension/src/components/WalletActivity.tsx b/packages/taler-wallet-webextension/src/components/WalletActivity.tsx index d8d25f90c..ab3668ca0 100644 --- a/packages/taler-wallet-webextension/src/components/WalletActivity.tsx +++ b/packages/taler-wallet-webextension/src/components/WalletActivity.tsx @@ -312,34 +312,34 @@ function ShowExchangeStateTransition({ events }: MoreInfoPRops): VNode { <dt>Exchange</dt> <dd>{not.exchangeBaseUrl}</dd> {not.oldExchangeState && - not.newExchangeState.exchangeEntryStatus !== + not.newExchangeState?.exchangeEntryStatus !== not.oldExchangeState?.exchangeEntryStatus && ( <Fragment> <dt>Entry status</dt> <dd> from {not.oldExchangeState.exchangeEntryStatus} to{" "} - {not.newExchangeState.exchangeEntryStatus} + {not.newExchangeState?.exchangeEntryStatus} </dd> </Fragment> )} {not.oldExchangeState && - not.newExchangeState.exchangeUpdateStatus !== + not.newExchangeState?.exchangeUpdateStatus !== not.oldExchangeState?.exchangeUpdateStatus && ( <Fragment> <dt>Update status</dt> <dd> from {not.oldExchangeState.exchangeUpdateStatus} to{" "} - {not.newExchangeState.exchangeUpdateStatus} + {not.newExchangeState?.exchangeUpdateStatus} </dd> </Fragment> )} {not.oldExchangeState && - not.newExchangeState.tosStatus !== not.oldExchangeState?.tosStatus && ( + not.newExchangeState?.tosStatus !== not.oldExchangeState?.tosStatus && ( <Fragment> <dt>Tos status</dt> <dd> from {not.oldExchangeState.tosStatus} to{" "} - {not.newExchangeState.tosStatus} + {not.newExchangeState?.tosStatus} </dd> </Fragment> )} diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts index deee83751..a3ef54210 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts +++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts @@ -21,6 +21,7 @@ import { PreparePayResult, PreparePayResultType, TalerProtocolTimestamp, + TransactionIdStr, } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { useTranslationContext } from "@gnu-taler/web-util/browser"; @@ -99,11 +100,13 @@ export function useComponentState({ const paymentPossible: PreparePayResult = { status: PreparePayResultType.PaymentPossible, - proposalId: "fakeID", contractTerms: {} as any, contractTermsHash: "asd", amountRaw: hook.response.p2p.amount, amountEffective: hook.response.p2p.amount, + scopes: [], + transactionId: "txn:pay:123" as TransactionIdStr, + talerUri: "taler://pay/example.com/", } as PreparePayResult; const insufficientBalance: PreparePayResult = { diff --git a/packages/taler-wallet-webextension/src/cta/Payment/state.ts b/packages/taler-wallet-webextension/src/cta/Payment/state.ts index 4733e5aee..78f8ad867 100644 --- a/packages/taler-wallet-webextension/src/cta/Payment/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Payment/state.ts @@ -21,10 +21,10 @@ import { PreparePayResultType, } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { useEffect } from "preact/hooks"; import { alertFromError, useAlertContext } from "../../context/alert.js"; import { useBackendContext } from "../../context/backend.js"; -import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { useAsyncAsHook } from "../../hooks/useAsyncAsHook.js"; import { ButtonHandler } from "../../mui/handlers.js"; import { Props, State } from "./index.js"; @@ -143,7 +143,7 @@ export function useComponentState({ async function doPayment(): Promise<void> { const res = await api.wallet.call(WalletApiOperation.ConfirmPay, { - proposalId: payStatus.proposalId, + transactionId: payStatus.transactionId, }); // handle confirm pay if (res.type !== ConfirmPayResultType.Done) { diff --git a/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx b/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx index d03f48746..bd11e8d29 100644 --- a/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx +++ b/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx @@ -63,9 +63,8 @@ export const NoEnoughBalanceAvailable = tests.createExample(BaseView, { balanceExchangeDepositable: "USD:9.5" as AmountString, perExchange: {}, }, - talerUri: "taler://pay/..", - - proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0", + talerUri: + "taler://payment/96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0", contractTerms: { merchant: { name: "the merchant", @@ -76,6 +75,7 @@ export const NoEnoughBalanceAvailable = tests.createExample(BaseView, { summary: "some beers", amount: "USD:10", } as Partial<ContractTerms> as any, + scopes: [], amountRaw: "USD:10" as AmountString, }, }); @@ -92,7 +92,6 @@ export const NoEnoughBalanceMaterial = tests.createExample(BaseView, { uri: "", payStatus: { - transactionId: " " as TransactionIdStr, status: PreparePayResultType.InsufficientBalance, balanceDetails: { amountRequested: "USD:10" as AmountString, @@ -106,8 +105,9 @@ export const NoEnoughBalanceMaterial = tests.createExample(BaseView, { perExchange: {}, }, talerUri: "taler://pay/..", - - proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0", + transactionId: + "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as TransactionIdStr, + scopes: [], contractTerms: { merchant: { name: "the merchant", @@ -134,7 +134,6 @@ export const NoEnoughBalanceAgeAcceptable = tests.createExample(BaseView, { uri: "", payStatus: { - transactionId: " " as TransactionIdStr, status: PreparePayResultType.InsufficientBalance, balanceDetails: { amountRequested: "USD:10" as AmountString, @@ -148,8 +147,9 @@ export const NoEnoughBalanceAgeAcceptable = tests.createExample(BaseView, { perExchange: {}, }, talerUri: "taler://pay/..", - - proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0", + transactionId: + "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as TransactionIdStr, + scopes: [], contractTerms: { merchant: { name: "the merchant", @@ -177,7 +177,9 @@ export const NoEnoughBalanceMerchantAcceptable = tests.createExample(BaseView, { uri: "", payStatus: { - transactionId: " " as TransactionIdStr, + transactionId: + "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as TransactionIdStr, + scopes: [], status: PreparePayResultType.InsufficientBalance, balanceDetails: { amountRequested: "USD:10" as AmountString, @@ -191,8 +193,6 @@ export const NoEnoughBalanceMerchantAcceptable = tests.createExample(BaseView, { perExchange: {}, }, talerUri: "taler://pay/..", - - proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0", contractTerms: { merchant: { name: "the merchant", @@ -221,7 +221,9 @@ export const NoEnoughBalanceMerchantDepositable = tests.createExample( uri: "", payStatus: { - transactionId: " " as TransactionIdStr, + transactionId: + "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as TransactionIdStr, + scopes: [], status: PreparePayResultType.InsufficientBalance, balanceDetails: { amountRequested: "USD:10" as AmountString, @@ -235,8 +237,6 @@ export const NoEnoughBalanceMerchantDepositable = tests.createExample( perExchange: {}, }, talerUri: "taler://pay/..", - - proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0", contractTerms: { merchant: { name: "the merchant", @@ -264,7 +264,9 @@ export const NoEnoughBalanceFeeGap = tests.createExample(BaseView, { uri: "", payStatus: { - transactionId: " " as TransactionIdStr, + transactionId: + "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as TransactionIdStr, + scopes: [], status: PreparePayResultType.InsufficientBalance, balanceDetails: { amountRequested: "USD:10" as AmountString, @@ -278,8 +280,6 @@ export const NoEnoughBalanceFeeGap = tests.createExample(BaseView, { perExchange: {}, }, talerUri: "taler://pay/..", - - proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0", contractTerms: { merchant: { name: "the merchant", @@ -310,12 +310,13 @@ export const PaymentPossible = tests.createExample(BaseView, { uri: "taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0", payStatus: { - transactionId: " " as TransactionIdStr, + transactionId: + "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as TransactionIdStr, + scopes: [], status: PreparePayResultType.PaymentPossible, talerUri: "taler://pay/..", amountEffective: "USD:10" as AmountString, amountRaw: "USD:10" as AmountString, - contractTerms: { nonce: "123213123", merchant: { @@ -331,7 +332,6 @@ export const PaymentPossible = tests.createExample(BaseView, { summary: "some beers", } as Partial<ContractTerms> as any, contractTermsHash: "123456", - proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0", }, }); @@ -350,11 +350,13 @@ export const PaymentPossibleWithFee = tests.createExample(BaseView, { uri: "taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0", payStatus: { - transactionId: " " as TransactionIdStr, + transactionId: + "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as TransactionIdStr, status: PreparePayResultType.PaymentPossible, talerUri: "taler://pay/..", amountEffective: "USD:10.20" as AmountString, amountRaw: "USD:10" as AmountString, + scopes: [], contractTerms: { nonce: "123213123", @@ -368,7 +370,6 @@ export const PaymentPossibleWithFee = tests.createExample(BaseView, { summary: "some beers", } as Partial<ContractTerms> as any, contractTermsHash: "123456", - proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0", }, }); @@ -387,11 +388,13 @@ export const TicketWithAProductList = tests.createExample(BaseView, { uri: "taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0", payStatus: { - transactionId: " " as TransactionIdStr, + transactionId: + "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as TransactionIdStr, status: PreparePayResultType.PaymentPossible, talerUri: "taler://pay/..", amountEffective: "USD:10.20" as AmountString, amountRaw: "USD:10" as AmountString, + scopes: [], contractTerms: { nonce: "123213123", @@ -424,7 +427,6 @@ export const TicketWithAProductList = tests.createExample(BaseView, { ], } as Partial<ContractTerms> as any, contractTermsHash: "123456", - proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0", }, }); @@ -443,11 +445,13 @@ export const TicketWithShipping = tests.createExample(BaseView, { uri: "taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0", payStatus: { - transactionId: " " as TransactionIdStr, + transactionId: + "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as TransactionIdStr, status: PreparePayResultType.PaymentPossible, talerUri: "taler://pay/..", amountEffective: "USD:10.20" as AmountString, amountRaw: "USD:10" as AmountString, + scopes: [], contractTerms: { nonce: "123213123", @@ -475,7 +479,6 @@ export const TicketWithShipping = tests.createExample(BaseView, { }, } as Partial<ContractTerms> as any, contractTermsHash: "123456", - proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0", }, }); @@ -491,7 +494,9 @@ export const AlreadyConfirmedByOther = tests.createExample(BaseView, { uri: "taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0", payStatus: { - transactionId: " " as TransactionIdStr, + transactionId: + "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as TransactionIdStr, + scopes: [], status: PreparePayResultType.AlreadyConfirmed, talerUri: "taler://pay/..", amountEffective: "USD:10" as AmountString, @@ -507,7 +512,6 @@ export const AlreadyConfirmedByOther = tests.createExample(BaseView, { amount: "USD:10", } as Partial<ContractTerms> as any, contractTermsHash: "123456", - proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0", paid: false, }, }); diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts index 91bde9369..8d4ad0bde 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/index.ts @@ -47,8 +47,8 @@ export interface PropsFromURI { export interface PropsFromParams { talerExchangeWithdrawUri: string | undefined; - scope: ScopeInfo; - amount: string | undefined; + scope: ScopeInfo | undefined; + amount: AmountJson | undefined; cancel: () => Promise<void>; onSuccess: (txid: string) => Promise<void>; } diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts index 8a862d200..232bfe9e2 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts @@ -37,14 +37,14 @@ import { PropsFromParams, PropsFromURI, State } from "./index.js"; export function useComponentStateFromParams({ talerExchangeWithdrawUri: maybeTalerUri, - amount, scope, + amount: paramsAmount, cancel, onSuccess, }: PropsFromParams): RecursiveState<State> { const api = useBackendContext(); const { i18n } = useTranslationContext(); - const paramsAmount = amount ? Amounts.parse(amount) : undefined; + // const paramsAmount = amount ? Amounts.parse(amount) : undefined; const [updatedExchangeByUser, setUpdatedExchangeByUser] = useState<string>(); const uriInfoHook = useAsyncAsHook(async () => { const exchanges = await api.wallet.call( @@ -75,6 +75,10 @@ export function useComponentStateFromParams({ return { amount: chosenAmount, exchanges, exchange: ex }; }); + useEffect(() => { + uriInfoHook?.retry(); + }, [paramsAmount]); + if (!uriInfoHook) return { status: "loading", error: undefined }; if (uriInfoHook.hasError) { @@ -88,14 +92,22 @@ export function useComponentStateFromParams({ }; } - useEffect(() => { - uriInfoHook?.retry(); - }, [amount]); + const currency = uriInfoHook.response.exchange?.currency ?? scope?.currency; const exchangeByTalerUri = uriInfoHook.response.exchange?.exchangeBaseUrl; const exchangeList = uriInfoHook.response.exchanges.exchanges; const maybeAmount = uriInfoHook.response.amount ?? paramsAmount; + if (!currency) { + return { + status: "error", + error: alertFromError( + i18n, + i18n.str`Could not load the list of exchanges`, + {} as any, + ), + }; + } // if (!maybeAmount) { // const exchangeBaseUrl = @@ -156,7 +168,7 @@ export function useComponentStateFromParams({ // }; // }; // } - const chosenAmount = maybeAmount ?? Amounts.zeroOfCurrency(scope.currency); + const chosenAmount = maybeAmount ?? Amounts.zeroOfCurrency(currency); async function doManualWithdraw( exchange: string, diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts index 5a75cb4be..d2cc139d1 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/test.ts @@ -29,8 +29,8 @@ import { TransactionIdStr, } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { expect } from "chai"; import * as tests from "@gnu-taler/web-util/testing"; +import { expect } from "chai"; import { createWalletApiMock } from "../../test-utils.js"; import { useComponentStateFromURI } from "./state.js"; @@ -186,6 +186,7 @@ describe("Withdraw CTA states", () => { type: ScopeType.Exchange, url: "http://asd", }, + exchangeBaseUrl: "http://asd", withdrawalAccountsList: [], ageRestrictionOptions: [], numCoins: 42, @@ -262,6 +263,7 @@ describe("Withdraw CTA states", () => { type: ScopeType.Exchange, url: "http://asd", }, + exchangeBaseUrl: "http://asd", tosAccepted: false, withdrawalAccountsList: [], ageRestrictionOptions: [], diff --git a/packages/taler-wallet-webextension/src/i18n/de.po b/packages/taler-wallet-webextension/src/i18n/de.po index 73b619c8e..87b73e860 100644 --- a/packages/taler-wallet-webextension/src/i18n/de.po +++ b/packages/taler-wallet-webextension/src/i18n/de.po @@ -17,8 +17,8 @@ msgstr "" "Project-Id-Version: Taler Wallet\n" "Report-Msgid-Bugs-To: languages@taler.net\n" "POT-Creation-Date: 2016-11-23 00:00+0100\n" -"PO-Revision-Date: 2024-09-26 05:33+0000\n" -"Last-Translator: LukBru <zur@posteo.de>\n" +"PO-Revision-Date: 2024-11-05 15:40+0000\n" +"Last-Translator: Stefan Kügel <stefan.kuegel@taler.net>\n" "Language-Team: German <https://weblate.taler.net/projects/gnu-taler/" "webextensions/de/>\n" "Language: de\n" @@ -255,7 +255,7 @@ msgstr "Konnte die Umsatzanzeige nicht laden" #: src/popup/BalancePage.tsx:175 #, c-format msgid "Add" -msgstr "" +msgstr "Hinzufügen" #: src/popup/BalancePage.tsx:179 #, c-format @@ -380,17 +380,17 @@ msgstr "" #: src/components/ShowFullContractTermPopup.tsx:277 #, c-format msgid "Products" -msgstr "" +msgstr "Artikel" #: src/components/ShowFullContractTermPopup.tsx:289 #, c-format msgid "Created at" -msgstr "" +msgstr "Erstellungsdatum" #: src/components/ShowFullContractTermPopup.tsx:304 #, c-format msgid "Refund deadline" -msgstr "" +msgstr "Rückerstattungsfrist" #: src/components/ShowFullContractTermPopup.tsx:319 #, c-format @@ -420,12 +420,12 @@ msgstr "" #: src/components/ShowFullContractTermPopup.tsx:378 #, c-format msgid "Max fee" -msgstr "" +msgstr "Höchster Gebührenbetrag" #: src/components/ShowFullContractTermPopup.tsx:386 #, c-format msgid "Minimum age" -msgstr "" +msgstr "Mindestalter" #: src/components/ShowFullContractTermPopup.tsx:398 #, c-format @@ -445,7 +445,7 @@ msgstr "Exchange" #: src/components/Part.tsx:148 #, c-format msgid "Bank account" -msgstr "" +msgstr "Bankkonto" #: src/components/Part.tsx:160 #, c-format @@ -455,7 +455,7 @@ msgstr "" #: src/components/Part.tsx:163 #, c-format msgid "IBAN" -msgstr "" +msgstr "IBAN" #: src/cta/Deposit/views.tsx:38 #, fuzzy, c-format @@ -517,12 +517,12 @@ msgstr "" #: src/components/BankDetailsByPaytoType.tsx:110 #, c-format msgid "Account" -msgstr "" +msgstr "Konto" #: src/components/BankDetailsByPaytoType.tsx:116 #, c-format msgid "Bank host" -msgstr "" +msgstr "Server der Bank (Bank host)" #: src/components/BankDetailsByPaytoType.tsx:139 #, c-format @@ -537,7 +537,7 @@ msgstr "Buchungsvermerk" #: src/components/BankDetailsByPaytoType.tsx:154 #, c-format msgid "Receiver name" -msgstr "" +msgstr "Name des Begünstigten" #: src/wallet/Transaction.tsx:98 #, c-format @@ -597,6 +597,8 @@ msgid "" "Make sure to use the correct subject, otherwise the money will not arrive in " "this wallet." msgstr "" +"Bitte vergewissern Sie sich, dass Sie den Buchungsvermerk richtig angeben, " +"da sonst das e-Geld nicht in diesem Wallet ankommt." #: src/wallet/Transaction.tsx:298 #, c-format @@ -630,10 +632,7 @@ msgstr "" #: src/wallet/Transaction.tsx:385 #, fuzzy, c-format msgid "%1$s %2$s on %3$s" -msgstr "" -"%1$s\n" -" möchte einen Vertrag über %2$s\n" -" mit Ihnen abschließen." +msgstr "%1$s %2$s über %3$s" #: src/wallet/Transaction.tsx:415 #, c-format @@ -679,7 +678,7 @@ msgstr "" #: src/wallet/Transaction.tsx:542 #, c-format msgid "Refund" -msgstr "" +msgstr "Rückerstattung" #: src/wallet/Transaction.tsx:555 #, c-format @@ -694,7 +693,7 @@ msgstr "" #: src/wallet/Transaction.tsx:593 #, c-format msgid "copy" -msgstr "" +msgstr "Kopieren" #: src/wallet/Transaction.tsx:596 #, c-format @@ -719,7 +718,7 @@ msgstr "" #: src/wallet/Transaction.tsx:635 #, c-format msgid "Exchange" -msgstr "Exchange" +msgstr "Zahlungsdienstleister" #: src/wallet/Transaction.tsx:641 #, c-format @@ -734,12 +733,12 @@ msgstr "" #: src/wallet/Transaction.tsx:710 #, c-format msgid "Transfer" -msgstr "" +msgstr "Überweisung" #: src/wallet/Transaction.tsx:844 -#, fuzzy, c-format +#, c-format msgid "Country" -msgstr "Betrag" +msgstr "Land" #: src/wallet/Transaction.tsx:852 #, c-format @@ -749,42 +748,42 @@ msgstr "" #: src/wallet/Transaction.tsx:860 #, c-format msgid "Building number" -msgstr "" +msgstr "Zusätzliche Adressangabe" #: src/wallet/Transaction.tsx:868 #, c-format msgid "Building name" -msgstr "" +msgstr "Bezeichnung des Gebäudes" #: src/wallet/Transaction.tsx:876 #, c-format msgid "Street" -msgstr "" +msgstr "Str." #: src/wallet/Transaction.tsx:884 #, c-format msgid "Post code" -msgstr "" +msgstr "Postleitzahl" #: src/wallet/Transaction.tsx:892 #, c-format msgid "Town location" -msgstr "" +msgstr "Ortsteil" #: src/wallet/Transaction.tsx:900 #, c-format msgid "Town" -msgstr "" +msgstr "Ort" #: src/wallet/Transaction.tsx:908 #, c-format msgid "District" -msgstr "" +msgstr "Bezirk/Kanton" #: src/wallet/Transaction.tsx:916 #, c-format msgid "Country subdivision" -msgstr "" +msgstr "Region" #: src/wallet/Transaction.tsx:935 #, c-format @@ -809,7 +808,7 @@ msgstr "Abheben" #: src/wallet/Transaction.tsx:1146 #, c-format msgid "Price" -msgstr "" +msgstr "Preis" #: src/wallet/Transaction.tsx:1156 #, c-format @@ -900,6 +899,8 @@ msgstr "" #, c-format msgid "You have no balance for this currency. Withdraw digital cash first." msgstr "" +"Sie haben kein Guthaben in dieser Währung. Bitte führen Sie zuerst eine " +"Abhebung durch, um e-Geld dieser Währung zu erhalten." #: src/cta/Payment/views.tsx:364 #, c-format @@ -926,7 +927,7 @@ msgstr "Konnte die Umsatzanzeige nicht laden" #: src/cta/Refund/views.tsx:48 #, c-format msgid "Digital cash refund" -msgstr "" +msgstr "Erstattung von e-Geld" #: src/cta/Refund/views.tsx:52 #, c-format @@ -944,11 +945,9 @@ msgid "Total to refund" msgstr "Insgesamt abgehoben" #: src/cta/Refund/views.tsx:106 -#, fuzzy, c-format +#, c-format msgid "The merchant "%1$s" is offering you a refund." -msgstr "" -"Der Händler %1$s bietet Ihnen eine Aufwandsentschädigung von %2$s durch den " -"Exchange %3$s" +msgstr "Der Verkäufer %1$s bietet Ihnen eine Rückerstattung an." #: src/cta/Refund/views.tsx:115 #, c-format @@ -981,11 +980,9 @@ msgid "Digital cash tip" msgstr "" #: src/cta/Tip/views.tsx:66 -#, fuzzy, c-format +#, c-format msgid "The merchant is offering you a tip" -msgstr "" -"Der Händler %1$s bietet Ihnen eine Aufwandsentschädigung von %2$s durch den " -"Exchange %3$s" +msgstr "Der Verkäufer bietet Ihnen eine Aufwandsentschädigung an" #: src/cta/Tip/views.tsx:74 #, c-format @@ -1102,7 +1099,7 @@ msgstr "" #: src/wallet/ExchangeSelection/views.tsx:241 #, c-format msgid "currency" -msgstr "" +msgstr "Währung" #: src/wallet/ExchangeSelection/views.tsx:249 #, c-format @@ -1110,9 +1107,9 @@ msgid "Operations" msgstr "" #: src/wallet/ExchangeSelection/views.tsx:252 -#, fuzzy, c-format +#, c-format msgid "Deposits" -msgstr "%1$s zahlen" +msgstr "Auszahlungen" #: src/wallet/ExchangeSelection/views.tsx:259 #, c-format @@ -1188,7 +1185,7 @@ msgstr "" #: src/cta/Withdraw/views.tsx:74 #, c-format msgid "Digital cash withdrawal" -msgstr "" +msgstr "Abhebung von e-Geld" #: src/cta/Withdraw/views.tsx:79 #, c-format @@ -1233,7 +1230,7 @@ msgstr "" #: src/cta/TransferCreate/views.tsx:55 #, c-format msgid "Digital cash transfer" -msgstr "" +msgstr "Übertragung von e-Geld" #: src/cta/TransferCreate/views.tsx:59 #, c-format @@ -1246,9 +1243,9 @@ msgid "Could not finish the pickup operation" msgstr "" #: src/wallet/CreateManualWithdraw.tsx:149 -#, fuzzy, c-format +#, c-format msgid "Manual Withdrawal for %1$s" -msgstr "Manuelles Abheben" +msgstr "Manuelles Abheben für %1$s" #: src/wallet/CreateManualWithdraw.tsx:154 #, c-format @@ -1257,6 +1254,10 @@ msgid "" "send the coins to this wallet after receiving a wire transfer with the " "correct subject." msgstr "" +"Wählen Sie einen Zahlungsdienstleister, von dem das Wallet e-Geld abheben " +"soll. Sobald der Zahlungsdienstleister eine Überweisung mit dem " +"übereinstimmenden Buchungsvermerk erhalten hat, wird er das e-Geld an dieses " +"Wallet senden." #: src/wallet/CreateManualWithdraw.tsx:162 #, c-format @@ -1366,7 +1367,7 @@ msgstr "Allgemeine Geschäftsbedingungen (AGB) ansehen" #: src/wallet/ExchangeAddConfirm.tsx:45 #, c-format msgid "Exchange URL" -msgstr "URL des Exchange" +msgstr "URL des Zahlungsdienstleisters (Exchange-URL)" #: src/wallet/ExchangeAddConfirm.tsx:70 #, c-format @@ -1406,7 +1407,7 @@ msgstr "" #: src/wallet/ExchangeSetUrl.tsx:167 #, c-format msgid "loading" -msgstr "" +msgstr "lädt" #: src/wallet/ExchangeSetUrl.tsx:174 #, c-format @@ -1456,7 +1457,7 @@ msgstr "" #: src/wallet/ProviderAddPage.tsx:147 #, c-format msgid "URL" -msgstr "" +msgstr "URL" #: src/wallet/ProviderAddPage.tsx:158 #, c-format @@ -1587,7 +1588,7 @@ msgstr "" #: src/wallet/Settings.tsx:191 #, c-format msgid "ok" -msgstr "" +msgstr "OK" #: src/wallet/Settings.tsx:197 #, c-format diff --git a/packages/taler-wallet-webextension/src/i18n/es.po b/packages/taler-wallet-webextension/src/i18n/es.po index eb43e2949..dacf3b18a 100644 --- a/packages/taler-wallet-webextension/src/i18n/es.po +++ b/packages/taler-wallet-webextension/src/i18n/es.po @@ -17,8 +17,8 @@ msgstr "" "Project-Id-Version: Taler Wallet\n" "Report-Msgid-Bugs-To: languages@taler.net\n" "POT-Creation-Date: 2016-11-23 00:00+0100\n" -"PO-Revision-Date: 2024-07-03 18:32+0000\n" -"Last-Translator: Luis Avalos <avalos.diaz.0577@gmail.com>\n" +"PO-Revision-Date: 2024-11-05 15:40+0000\n" +"Last-Translator: Stefan Kügel <stefan.kuegel@taler.net>\n" "Language-Team: Spanish <https://weblate.taler.net/projects/gnu-taler/" "webextensions/es/>\n" "Language: es\n" @@ -529,7 +529,7 @@ msgstr "Cuenta" #: src/components/BankDetailsByPaytoType.tsx:116 #, c-format msgid "Bank host" -msgstr "Banco anfitrión" +msgstr "Host del banco" #: src/components/BankDetailsByPaytoType.tsx:139 #, c-format @@ -1215,7 +1215,7 @@ msgstr "No se pudo completar la operación de retirada" #: src/cta/Withdraw/views.tsx:127 #, c-format msgid "Age restriction" -msgstr "Restricción etaria" +msgstr "Restricción de edad" #: src/cta/Withdraw/views.tsx:145 #, c-format diff --git a/packages/taler-wallet-webextension/src/i18n/fr.po b/packages/taler-wallet-webextension/src/i18n/fr.po index 462eb30f7..4cdfeb953 100644 --- a/packages/taler-wallet-webextension/src/i18n/fr.po +++ b/packages/taler-wallet-webextension/src/i18n/fr.po @@ -17,8 +17,8 @@ msgstr "" "Project-Id-Version: Taler Wallet\n" "Report-Msgid-Bugs-To: languages@taler.net\n" "POT-Creation-Date: 2016-11-23 00:00+0100\n" -"PO-Revision-Date: 2024-02-28 08:07+0000\n" -"Last-Translator: d0p1 <contact@d0p1.eu>\n" +"PO-Revision-Date: 2024-11-14 17:39+0000\n" +"Last-Translator: Emmanuel Benoist <emmanuel.benoist@bfh.ch>\n" "Language-Team: French <https://weblate.taler.net/projects/gnu-taler/" "webextensions/fr/>\n" "Language: fr\n" @@ -26,7 +26,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n" -"X-Generator: Weblate 5.2.1\n" +"X-Generator: Weblate 5.5.5\n" #: src/NavigationBar.tsx:139 #, c-format @@ -54,9 +54,9 @@ msgid "Dev" msgstr "" #: src/mui/Typography.tsx:122 -#, c-format +#, c-format, fuzzy msgid "%1$s" -msgstr "" +msgstr "%1$s" #: src/components/PendingTransactions.tsx:74 #, c-format @@ -253,7 +253,7 @@ msgstr "" #: src/popup/BalancePage.tsx:175 #, c-format msgid "Add" -msgstr "" +msgstr "Ajouter" #: src/popup/BalancePage.tsx:179 #, c-format @@ -323,12 +323,12 @@ msgstr "" #: src/components/ShowFullContractTermPopup.tsx:189 #, c-format msgid "Summary" -msgstr "" +msgstr "Résumé" #: src/components/ShowFullContractTermPopup.tsx:195 #, c-format msgid "Amount" -msgstr "" +msgstr "Montant" #: src/components/ShowFullContractTermPopup.tsx:203 #, c-format @@ -368,7 +368,7 @@ msgstr "" #: src/components/ShowFullContractTermPopup.tsx:256 #, c-format msgid "Delivery date" -msgstr "" +msgstr "Date de livraison" #: src/components/ShowFullContractTermPopup.tsx:271 #, c-format @@ -383,12 +383,12 @@ msgstr "" #: src/components/ShowFullContractTermPopup.tsx:289 #, c-format msgid "Created at" -msgstr "" +msgstr "Créé à" #: src/components/ShowFullContractTermPopup.tsx:304 #, c-format msgid "Refund deadline" -msgstr "" +msgstr "Date limite de remboursement" #: src/components/ShowFullContractTermPopup.tsx:319 #, c-format @@ -403,7 +403,7 @@ msgstr "" #: src/components/ShowFullContractTermPopup.tsx:354 #, c-format msgid "Fulfillment URL" -msgstr "" +msgstr "URL du service de traitement des commandes" #: src/components/ShowFullContractTermPopup.tsx:360 #, c-format @@ -418,12 +418,12 @@ msgstr "" #: src/components/ShowFullContractTermPopup.tsx:378 #, c-format msgid "Max fee" -msgstr "" +msgstr "Frais maximums" #: src/components/ShowFullContractTermPopup.tsx:386 #, c-format msgid "Minimum age" -msgstr "" +msgstr "Age minimum" #: src/components/ShowFullContractTermPopup.tsx:398 #, c-format @@ -443,7 +443,7 @@ msgstr "" #: src/components/Part.tsx:148 #, c-format msgid "Bank account" -msgstr "" +msgstr "Compte bancaire" #: src/components/Part.tsx:160 #, c-format @@ -453,7 +453,7 @@ msgstr "" #: src/components/Part.tsx:163 #, c-format msgid "IBAN" -msgstr "" +msgstr "IBAN" #: src/cta/Deposit/views.tsx:38 #, c-format @@ -515,12 +515,12 @@ msgstr "" #: src/components/BankDetailsByPaytoType.tsx:110 #, c-format msgid "Account" -msgstr "" +msgstr "Compte" #: src/components/BankDetailsByPaytoType.tsx:116 #, c-format msgid "Bank host" -msgstr "" +msgstr "Serveur de la banque" #: src/components/BankDetailsByPaytoType.tsx:139 #, c-format @@ -530,12 +530,12 @@ msgstr "" #: src/components/BankDetailsByPaytoType.tsx:148 #, c-format msgid "Subject" -msgstr "" +msgstr "Référence" #: src/components/BankDetailsByPaytoType.tsx:154 #, c-format msgid "Receiver name" -msgstr "" +msgstr "Nom du bénéficiaire" #: src/wallet/Transaction.tsx:98 #, c-format @@ -674,7 +674,7 @@ msgstr "" #: src/wallet/Transaction.tsx:542 #, c-format msgid "Refund" -msgstr "" +msgstr "Remboursement" #: src/wallet/Transaction.tsx:555 #, c-format @@ -704,7 +704,7 @@ msgstr "" #: src/wallet/Transaction.tsx:620 #, c-format msgid "Credit" -msgstr "" +msgstr "Crédit" #: src/wallet/Transaction.tsx:624 #, c-format @@ -714,7 +714,7 @@ msgstr "" #: src/wallet/Transaction.tsx:635 #, c-format msgid "Exchange" -msgstr "Exchange" +msgstr "Service de paiement" #: src/wallet/Transaction.tsx:641 #, c-format @@ -734,7 +734,7 @@ msgstr "" #: src/wallet/Transaction.tsx:844 #, c-format msgid "Country" -msgstr "" +msgstr "Pays" #: src/wallet/Transaction.tsx:852 #, c-format @@ -744,47 +744,47 @@ msgstr "" #: src/wallet/Transaction.tsx:860 #, c-format msgid "Building number" -msgstr "" +msgstr "Numéro de bâtiment" #: src/wallet/Transaction.tsx:868 #, c-format msgid "Building name" -msgstr "" +msgstr "Nom du bâtiment" #: src/wallet/Transaction.tsx:876 #, c-format msgid "Street" -msgstr "" +msgstr "Rue" #: src/wallet/Transaction.tsx:884 #, c-format msgid "Post code" -msgstr "" +msgstr "Code postal" #: src/wallet/Transaction.tsx:892 #, c-format msgid "Town location" -msgstr "" +msgstr "Localisation de la ville" #: src/wallet/Transaction.tsx:900 #, c-format msgid "Town" -msgstr "" +msgstr "Ville" #: src/wallet/Transaction.tsx:908 #, c-format msgid "District" -msgstr "" +msgstr "District" #: src/wallet/Transaction.tsx:916 #, c-format msgid "Country subdivision" -msgstr "" +msgstr "Subdivision du pays" #: src/wallet/Transaction.tsx:935 #, c-format msgid "Date" -msgstr "" +msgstr "Date" #: src/wallet/Transaction.tsx:990 #, c-format @@ -804,12 +804,12 @@ msgstr "" #: src/wallet/Transaction.tsx:1146 #, c-format msgid "Price" -msgstr "" +msgstr "Prix" #: src/wallet/Transaction.tsx:1156 #, c-format msgid "Refunded" -msgstr "" +msgstr "Remboursée" #: src/wallet/Transaction.tsx:1220 #, c-format @@ -1187,7 +1187,7 @@ msgstr "" #: src/cta/Withdraw/views.tsx:127 #, c-format msgid "Age restriction" -msgstr "" +msgstr "Restriction d'âge" #: src/cta/Withdraw/views.tsx:145 #, c-format @@ -1355,7 +1355,7 @@ msgstr "" #: src/wallet/ExchangeAddConfirm.tsx:45 #, c-format msgid "Exchange URL" -msgstr "" +msgstr "URL de l'exchange" #: src/wallet/ExchangeAddConfirm.tsx:70 #, c-format @@ -1450,7 +1450,7 @@ msgstr "" #: src/wallet/ProviderAddPage.tsx:158 #, c-format msgid "Name" -msgstr "" +msgstr "Nom" #: src/wallet/ProviderAddPage.tsx:212 #, c-format @@ -1961,7 +1961,7 @@ msgstr "" #: src/components/EditableText.tsx:45 #, c-format msgid "Edit" -msgstr "" +msgstr "Editer" #: src/wallet/ManualWithdrawPage.tsx:102 #, c-format diff --git a/packages/taler-wallet-webextension/src/i18n/sv.po b/packages/taler-wallet-webextension/src/i18n/sv.po index bb3caea4b..d7ca20731 100644 --- a/packages/taler-wallet-webextension/src/i18n/sv.po +++ b/packages/taler-wallet-webextension/src/i18n/sv.po @@ -17,8 +17,8 @@ msgstr "" "Project-Id-Version: Taler Wallet\n" "Report-Msgid-Bugs-To: languages@taler.net\n" "POT-Creation-Date: 2016-11-23 00:00+0100\n" -"PO-Revision-Date: 2023-03-06 22:06+0000\n" -"Last-Translator: Anonymous <noreply@weblate.org>\n" +"PO-Revision-Date: 2024-10-27 11:02+0000\n" +"Last-Translator: Stefan Kügel <stefan.kuegel@taler.net>\n" "Language-Team: Swedish <https://weblate.taler.net/projects/gnu-taler/" "webextensions/sv/>\n" "Language: sv\n" @@ -26,7 +26,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.13.1\n" +"X-Generator: Weblate 5.5.5\n" #: src/NavigationBar.tsx:139 #, c-format @@ -56,7 +56,7 @@ msgstr "" #: src/mui/Typography.tsx:122 #, c-format msgid "%1$s" -msgstr "" +msgstr "%1$s" #: src/components/PendingTransactions.tsx:74 #, c-format @@ -211,7 +211,7 @@ msgid "Backup valid until" msgstr "" #: src/wallet/AddNewActionView.tsx:57 -#, c-format +#, c-format, fuzzy msgid "Cancel" msgstr "Avbryt" diff --git a/packages/taler-wallet-webextension/src/i18n/tr.po b/packages/taler-wallet-webextension/src/i18n/tr.po index 3af81d0bc..3e334c45a 100644 --- a/packages/taler-wallet-webextension/src/i18n/tr.po +++ b/packages/taler-wallet-webextension/src/i18n/tr.po @@ -17,8 +17,8 @@ msgstr "" "Project-Id-Version: Taler Wallet\n" "Report-Msgid-Bugs-To: languages@taler.net\n" "POT-Creation-Date: 2016-11-23 00:00+0100\n" -"PO-Revision-Date: 2024-09-14 05:26+0000\n" -"Last-Translator: Muha Aliss <muhaaliss@tuta.io>\n" +"PO-Revision-Date: 2024-10-27 11:02+0000\n" +"Last-Translator: Stefan Kügel <stefan.kuegel@taler.net>\n" "Language-Team: Turkish <https://weblate.taler.net/projects/gnu-taler/" "webextensions/tr/>\n" "Language: tr\n" @@ -213,9 +213,9 @@ msgid "Backup valid until" msgstr "Yedekleme geçerlilik süresi" #: src/wallet/AddNewActionView.tsx:57 -#, c-format +#, c-format, fuzzy msgid "Cancel" -msgstr "İptal et" +msgstr "İptal" #: src/wallet/AddNewActionView.tsx:68 #, c-format diff --git a/packages/taler-wallet-webextension/src/i18n/uk.po b/packages/taler-wallet-webextension/src/i18n/uk.po index caee8330e..bad7290e1 100644 --- a/packages/taler-wallet-webextension/src/i18n/uk.po +++ b/packages/taler-wallet-webextension/src/i18n/uk.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: languages@taler.net\n" "POT-Creation-Date: 2016-11-23 00:00+0100\n" -"PO-Revision-Date: 2024-08-07 10:40+0000\n" -"Last-Translator: Vlada Svirsh <vlada.svirsh@students.bfh.ch>\n" +"PO-Revision-Date: 2024-11-05 15:40+0000\n" +"Last-Translator: Stefan Kügel <stefan.kuegel@taler.net>\n" "Language-Team: Ukrainian <https://weblate.taler.net/projects/gnu-taler/" "webextensions/uk/>\n" "Language: uk\n" @@ -518,7 +518,7 @@ msgstr "Рахунок" #: src/components/BankDetailsByPaytoType.tsx:116 #, c-format msgid "Bank host" -msgstr "Банк-хост" +msgstr "Хост банку" #: src/components/BankDetailsByPaytoType.tsx:139 #, c-format diff --git a/packages/taler-wallet-webextension/src/wallet/Application.tsx b/packages/taler-wallet-webextension/src/wallet/Application.tsx index 474f5acdb..783935143 100644 --- a/packages/taler-wallet-webextension/src/wallet/Application.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Application.tsx @@ -354,7 +354,7 @@ export function Application(): VNode { scope={s} goToWalletManualWithdraw={(s) => redirectTo( - Pages.ctaWithdrawManual({ + Pages.ctaWithdrawManualForScope({ scope: encodeCrockForURI(stringifyScopeInfoShort(s)), }), ) @@ -592,7 +592,7 @@ export function Application(): VNode { component={({ talerUri }: { talerUri: string }) => ( <CallToActionTemplate title={i18n.str`Digital cash withdrawal`}> <WithdrawPageFromURI - talerWithdrawUri={decodeCrockFromURI(talerUri)} + talerWithdrawUri={!talerUri ? undefined : decodeCrockFromURI(talerUri)} cancel={() => redirectTo(Pages.balance)} onSuccess={(tid: string) => redirectTo(Pages.balanceTransaction({ tid })) @@ -604,14 +604,38 @@ export function Application(): VNode { <Route path={Pages.ctaWithdrawManual.pattern} component={({ - scope, + // scope, amount, talerUri, }: { - scope: string; + // scope: string; amount: string; talerUri: string; }) => { + return ( + <CallToActionTemplate title={i18n.str`Digital cash withdrawal`}> + <WithdrawPageFromParams + scope={undefined} + talerExchangeWithdrawUri={!talerUri ? undefined : decodeCrockFromURI(talerUri)} + amount={Amounts.parse(amount)} + cancel={() => redirectTo(Pages.balance)} + onSuccess={(tid: string) => + redirectTo(Pages.balanceTransaction({ tid })) + } + /> + </CallToActionTemplate> + ); + }} + /> + <Route + path={Pages.ctaWithdrawManualForScope.pattern} + component={({ + scope, + amount, + }: { + scope: string; + amount: string; + }) => { if (!scope) return <Redirect to={Pages.balanceHistory({})} />; const s = parseScopeInfoShort(decodeCrockFromURI(scope)); if (!s) return <Redirect to={Pages.balanceHistory({})} />; @@ -619,9 +643,9 @@ export function Application(): VNode { return ( <CallToActionTemplate title={i18n.str`Digital cash withdrawal`}> <WithdrawPageFromParams + talerExchangeWithdrawUri={undefined} scope={s} - talerExchangeWithdrawUri={talerUri} - amount={amount} + amount={Amounts.parse(amount)} cancel={() => redirectTo(Pages.balance)} onSuccess={(tid: string) => redirectTo(Pages.balanceTransaction({ tid })) @@ -693,42 +717,56 @@ export function Application(): VNode { /> <Route path={Pages.ctaInvoicePay} - component={({ talerUri }: { talerUri: string }) => ( - <CallToActionTemplate title={i18n.str`Digital cash invoice`}> - <InvoicePayPage - talerPayPullUri={decodeCrockFromURI(talerUri)} - goToWalletManualWithdraw={(_amount?: string) => - // FIXME: use receiveCashForInvoice - redirectTo(Pages.receiveCash({})) - } - onClose={() => redirectTo(Pages.balance)} - onSuccess={(tid: string) => - redirectTo(Pages.balanceTransaction({ tid })) - } - /> - </CallToActionTemplate> - )} + component={({ talerUri }: { talerUri: string }) => { + const uri = (decodeCrockFromURI(talerUri)); + if (!uri) { + return <div>missing taler uri</div>; + } + + return ( + <CallToActionTemplate title={i18n.str`Digital cash invoice`}> + <InvoicePayPage + talerPayPullUri={uri} + goToWalletManualWithdraw={(_amount?: string) => + // FIXME: use receiveCashForInvoice + redirectTo(Pages.receiveCash({})) + } + onClose={() => redirectTo(Pages.balance)} + onSuccess={(tid: string) => + redirectTo(Pages.balanceTransaction({ tid })) + } + /> + </CallToActionTemplate> + ) + }} /> <Route path={Pages.ctaTransferPickup} - component={({ talerUri }: { talerUri: string }) => ( - <CallToActionTemplate title={i18n.str`Digital cash transfer`}> - <TransferPickupPage - talerPayPushUri={decodeCrockFromURI(talerUri)} - onClose={() => redirectTo(Pages.balance)} - onSuccess={(tid: string) => - redirectTo(Pages.balanceTransaction({ tid })) - } - /> - </CallToActionTemplate> - )} + component={({ talerUri }: { talerUri: string }) => { + const uri = (decodeCrockFromURI(talerUri)); + if (!uri) { + return <div>missing taler uri</div>; + } + + return ( + <CallToActionTemplate title={i18n.str`Digital cash transfer`}> + <TransferPickupPage + talerPayPushUri={uri} + onClose={() => redirectTo(Pages.balance)} + onSuccess={(tid: string) => + redirectTo(Pages.balanceTransaction({ tid })) + } + /> + </CallToActionTemplate> + ) + }} /> <Route path={Pages.ctaRecovery} component={({ talerRecoveryUri }: { talerRecoveryUri: string }) => ( <CallToActionTemplate title={i18n.str`Digital cash recovery`}> <RecoveryPage - talerRecoveryUri={decodeCrockFromURI(talerRecoveryUri)} + talerRecoveryUri={!talerRecoveryUri ? undefined : decodeCrockFromURI(talerRecoveryUri)} onCancel={() => redirectTo(Pages.balance)} onSuccess={() => redirectTo(Pages.backup)} /> @@ -740,7 +778,7 @@ export function Application(): VNode { component={({ talerUri }: { talerUri: string }) => ( <CallToActionTemplate title={i18n.str`Development experiment`}> <DevExperimentPage - talerExperimentUri={decodeCrockFromURI(talerUri)} + talerExperimentUri={!talerUri ? undefined : decodeCrockFromURI(talerUri)} onCancel={() => redirectTo(Pages.balanceHistory({}))} onSuccess={() => redirectTo(Pages.balanceHistory({}))} /> diff --git a/packages/taler-wallet-webextension/src/wallet/DestinationSelection/views.tsx b/packages/taler-wallet-webextension/src/wallet/DestinationSelection/views.tsx index cf34ceb35..6c19896f2 100644 --- a/packages/taler-wallet-webextension/src/wallet/DestinationSelection/views.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DestinationSelection/views.tsx @@ -14,7 +14,11 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import { KnownBankAccountsInfo, PaytoUri, stringifyPaytoUri } from "@gnu-taler/taler-util"; +import { + KnownBankAccountsInfo, + PaytoUri, + stringifyPaytoUri, +} from "@gnu-taler/taler-util"; import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { styled } from "@linaria/react"; import { Fragment, h, VNode } from "preact"; @@ -250,7 +254,10 @@ export function ReadyGetView({ <Grid item xs={1}> <Paper style={{ padding: 8 }}> <p> - <i18n.Translate>From a <pre style={{display:"inline"}}>taler://</pre> URI or QR code</i18n.Translate> + <i18n.Translate> + From a <pre style={{ display: "inline" }}>taler://</pre> URI + or QR code + </i18n.Translate> </p> <a href={Pages.qr}> <i18n.Translate>Enter URI here</i18n.Translate> @@ -291,7 +298,7 @@ export function ReadySendView({ <RowExample info={info} onClick={() => { - onSelectAccount(info.uri) + onSelectAccount(info.uri); }} // disabled={!amountHandler.onInput} /> @@ -324,6 +331,19 @@ export function ReadySendView({ </Button> </Paper> </Grid> + <Grid item xs={1}> + <Paper style={{ padding: 8 }}> + <p> + <i18n.Translate> + To a <pre style={{ display: "inline" }}>taler://</pre> URI or + QR code + </i18n.Translate> + </p> + <a href={Pages.qr}> + <i18n.Translate>Enter URI here</i18n.Translate> + </a> + </Paper> + </Grid> </Grid> </Grid> </Container> @@ -333,26 +353,23 @@ export function ReadySendView({ function RowExample({ info, disabled, - onClick + onClick, }: { info: KnownBankAccountsInfo; disabled?: boolean; onClick?: () => void; }): VNode { - - return ( <MediaExample data-disabled={disabled} onClick={onClick}> <MediaLeft> <CircleDiv> - <SvgIcon - title={info.alias} - dangerouslySetInnerHTML={{ - __html: bankIcon, - }} - color="currentColor" - /> - + <SvgIcon + title={info.alias} + dangerouslySetInnerHTML={{ + __html: bankIcon, + }} + color="currentColor" + /> </CircleDiv> </MediaLeft> <MediaBody> @@ -371,20 +388,19 @@ function RowExample({ ); } - function describeAccount(p: PaytoUri): string { if (!p.isKnown) { - return stringifyPaytoUri(p) + return stringifyPaytoUri(p); } switch (p.targetType) { case "iban": { - return p.iban + return p.iban; } case "x-taler-bank": { - return `${p.host}/${p.account}` + return `${p.host}/${p.account}`; } case "bitcoin": { - return `${p.address}` + return `${p.address}`; } } -}
\ No newline at end of file +} diff --git a/packages/taler-wallet-webextension/src/wxBackend.ts b/packages/taler-wallet-webextension/src/wxBackend.ts index 53028f906..259ff8274 100644 --- a/packages/taler-wallet-webextension/src/wxBackend.ts +++ b/packages/taler-wallet-webextension/src/wxBackend.ts @@ -44,6 +44,7 @@ import { import { HttpRequestLibrary } from "@gnu-taler/taler-util/http"; import { DbAccess, + HttpFactory, SynchronousCryptoWorkerFactoryPlain, Wallet, WalletApiOperation, @@ -54,6 +55,7 @@ import { importDb, } from "@gnu-taler/taler-wallet-core"; import { BrowserFetchHttpLib } from "@gnu-taler/web-util/browser"; +import { BridgeIDBFactory } from "../../idb-bridge/src/bridge-idb.js"; import { MessageFromFrontend, MessageResponse } from "./platform/api.js"; import { platform } from "./platform/background.js"; import { ExtensionOperations } from "./taler-wallet-interaction-loader.js"; @@ -460,8 +462,16 @@ async function reinitWallet(): Promise<void> { const settings = await platform.getSettingsFromStorage(); logger.info("Setting up wallet"); const wallet = await Wallet.create( - indexedDB as any, - httpFactory as any, + { + idbFactory: indexedDB as any as BridgeIDBFactory, + exportToFile() { + throw Error("DB file export not supported for platform webext"); + }, + getStats() { + throw Error("DB statistics not supported for platform webext"); + }, + }, + httpFactory as any as HttpFactory, timer, cryptoWorker, ); |