aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/wallet
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet')
-rw-r--r--packages/taler-wallet-webextension/src/wallet/Application.tsx18
-rw-r--r--packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts26
-rw-r--r--packages/taler-wallet-webextension/src/wallet/History.stories.tsx92
-rw-r--r--packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx3
4 files changed, 136 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Application.tsx b/packages/taler-wallet-webextension/src/wallet/Application.tsx
index ec34606dd..007f12bb7 100644
--- a/packages/taler-wallet-webextension/src/wallet/Application.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Application.tsx
@@ -29,7 +29,6 @@ import { CurrentAlerts } from "../components/CurrentAlerts.js";
import { LogoHeader } from "../components/LogoHeader.js";
import PendingTransactions from "../components/PendingTransactions.js";
import {
- Link,
LinkPrimary,
SubTitle,
WalletAction,
@@ -46,6 +45,7 @@ import { DepositPage as DepositPageCTA } from "../cta/Deposit/index.js";
import { InvoiceCreatePage } from "../cta/InvoiceCreate/index.js";
import { InvoicePayPage } from "../cta/InvoicePay/index.js";
import { PaymentPage } from "../cta/Payment/index.js";
+import { PaymentTemplatePage } from "../cta/PaymentTemplate/index.js";
import { RecoveryPage } from "../cta/Recovery/index.js";
import { RefundPage } from "../cta/Refund/index.js";
import { TipPage } from "../cta/Tip/index.js";
@@ -55,8 +55,9 @@ import {
WithdrawPageFromParams,
WithdrawPageFromURI,
} from "../cta/Withdraw/index.js";
-import { WalletNavBarOptions, Pages, WalletNavBar } from "../NavigationBar.js";
+import { Pages, WalletNavBar, WalletNavBarOptions } from "../NavigationBar.js";
import { platform } from "../platform/foreground.js";
+import CloseIcon from "../svg/close_24px.svg";
import { AddBackupProviderPage } from "./AddBackupProvider/index.js";
import { BackupPage } from "./BackupPage.js";
import { DepositPage } from "./DepositPage/index.js";
@@ -70,7 +71,6 @@ import { QrReaderPage } from "./QrReader.js";
import { SettingsPage } from "./Settings.js";
import { TransactionPage } from "./Transaction.js";
import { WelcomePage } from "./Welcome.js";
-import CloseIcon from "../svg/close_24px.svg";
export function Application(): VNode {
const { i18n } = useTranslationContext();
@@ -302,6 +302,18 @@ export function Application(): VNode {
)}
/>
<Route
+ path={Pages.ctaPay}
+ component={({
+ talerTemplateUri,
+ }: {
+ talerTemplateUri: string;
+ }) => (
+ <CallToActionTemplate title={i18n.str`Digital cash payment`}>
+ <PaymentTemplatePage talerTemplateUri={talerTemplateUri} />
+ </CallToActionTemplate>
+ )}
+ />
+ <Route
path={Pages.ctaRefund}
component={({ talerRefundUri }: { talerRefundUri: string }) => (
<CallToActionTemplate title={i18n.str`Digital cash refund`}>
diff --git a/packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts b/packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts
index bfd69f945..1489e2bb9 100644
--- a/packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts
+++ b/packages/taler-wallet-webextension/src/wallet/DepositPage/test.ts
@@ -23,6 +23,7 @@ import {
Amounts,
DepositGroupFees,
parsePaytoUri,
+ ScopeType,
stringifyPaytoUri,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
@@ -60,6 +61,11 @@ describe("DepositPage states", () => {
pendingIncoming: `${currency}:0`,
pendingOutgoing: `${currency}:0`,
requiresUserInput: false,
+ scopeInfo: {
+ currency,
+ type: ScopeType.Auditor,
+ url: "asd",
+ },
},
],
});
@@ -101,6 +107,11 @@ describe("DepositPage states", () => {
pendingIncoming: `${currency}:0`,
pendingOutgoing: `${currency}:0`,
requiresUserInput: false,
+ scopeInfo: {
+ currency,
+ type: ScopeType.Auditor,
+ url: "asd",
+ },
},
],
});
@@ -155,6 +166,11 @@ describe("DepositPage states", () => {
pendingIncoming: `${currency}:0`,
pendingOutgoing: `${currency}:0`,
requiresUserInput: false,
+ scopeInfo: {
+ currency,
+ type: ScopeType.Auditor,
+ url: "asd",
+ },
},
],
});
@@ -209,6 +225,11 @@ describe("DepositPage states", () => {
pendingIncoming: `${currency}:0`,
pendingOutgoing: `${currency}:0`,
requiresUserInput: false,
+ scopeInfo: {
+ currency,
+ type: ScopeType.Auditor,
+ url: "asd",
+ },
},
],
});
@@ -293,6 +314,11 @@ describe("DepositPage states", () => {
pendingIncoming: `${currency}:0`,
pendingOutgoing: `${currency}:0`,
requiresUserInput: false,
+ scopeInfo: {
+ currency,
+ type: ScopeType.Auditor,
+ url: "asd",
+ },
},
],
});
diff --git a/packages/taler-wallet-webextension/src/wallet/History.stories.tsx b/packages/taler-wallet-webextension/src/wallet/History.stories.tsx
index 13f4c8230..d89027e5f 100644
--- a/packages/taler-wallet-webextension/src/wallet/History.stories.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/History.stories.tsx
@@ -21,6 +21,7 @@
import {
PaymentStatus,
+ ScopeType,
TalerProtocolTimestamp,
TransactionCommon,
TransactionDeposit,
@@ -66,6 +67,7 @@ const exampleData = {
confirmed: false,
exchangePaytoUris: ["payto://x-taler-bank/bank/account"],
type: WithdrawalType.ManualTransfer,
+ reserveIsReady: false,
},
} as TransactionWithdrawal,
payment: {
@@ -176,6 +178,11 @@ export const SomeBalanceWithNoTransactions = tests.createExample(
pendingOutgoing: "TESTKUDOS:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
],
},
@@ -190,6 +197,11 @@ export const OneSimpleTransaction = tests.createExample(TestedComponent, {
pendingOutgoing: "USD:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
],
});
@@ -205,6 +217,11 @@ export const TwoTransactionsAndZeroBalance = tests.createExample(
pendingOutgoing: "USD:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
],
},
@@ -224,6 +241,11 @@ export const OneTransactionPending = tests.createExample(TestedComponent, {
pendingOutgoing: "USD:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
],
});
@@ -253,6 +275,11 @@ export const SomeTransactions = tests.createExample(TestedComponent, {
pendingOutgoing: "USD:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
],
});
@@ -277,6 +304,11 @@ export const SomeTransactionsWithTwoCurrencies = tests.createExample(
pendingOutgoing: "USD:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
{
available: "TESTKUDOS:10",
@@ -284,6 +316,11 @@ export const SomeTransactionsWithTwoCurrencies = tests.createExample(
pendingOutgoing: "TESTKUDOS:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
],
},
@@ -298,6 +335,11 @@ export const FiveOfficialCurrencies = tests.createExample(TestedComponent, {
pendingOutgoing: "USD:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
{
available: "EUR:881",
@@ -305,6 +347,11 @@ export const FiveOfficialCurrencies = tests.createExample(TestedComponent, {
pendingOutgoing: "TESTKUDOS:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
{
available: "COL:4043000.5",
@@ -312,6 +359,11 @@ export const FiveOfficialCurrencies = tests.createExample(TestedComponent, {
pendingOutgoing: "TESTKUDOS:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
{
available: "JPY:11564450.6",
@@ -319,6 +371,11 @@ export const FiveOfficialCurrencies = tests.createExample(TestedComponent, {
pendingOutgoing: "TESTKUDOS:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
{
available: "GBP:736",
@@ -326,6 +383,11 @@ export const FiveOfficialCurrencies = tests.createExample(TestedComponent, {
pendingOutgoing: "TESTKUDOS:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
],
});
@@ -341,6 +403,11 @@ export const FiveOfficialCurrenciesWithHighValue = tests.createExample(
pendingOutgoing: "USD:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
{
available: "EUR:10",
@@ -348,12 +415,22 @@ export const FiveOfficialCurrenciesWithHighValue = tests.createExample(
pendingOutgoing: "TESTKUDOS:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
{
available: "COL:443000123123000.5123123",
pendingIncoming: "TESTKUDOS:0",
pendingOutgoing: "TESTKUDOS:0",
hasPendingTransactions: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
requiresUserInput: false,
},
{
@@ -362,6 +439,11 @@ export const FiveOfficialCurrenciesWithHighValue = tests.createExample(
pendingOutgoing: "TESTKUDOS:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
{
available: "GBP:736001231231200.23123",
@@ -369,6 +451,11 @@ export const FiveOfficialCurrenciesWithHighValue = tests.createExample(
pendingOutgoing: "TESTKUDOS:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
],
},
@@ -388,6 +475,11 @@ export const PeerToPeer = tests.createExample(TestedComponent, {
pendingOutgoing: "USD:0",
hasPendingTransactions: false,
requiresUserInput: false,
+ scopeInfo: {
+ currency: "Ásd",
+ type: ScopeType.Auditor,
+ url: "",
+ },
},
],
});
diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx
index 21e9ee55e..a2aa9f26f 100644
--- a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx
@@ -77,6 +77,7 @@ const exampleData = {
type: TransactionType.Withdrawal,
exchangeBaseUrl: "http://exchange.taler",
withdrawalDetails: {
+ reserveIsReady: false,
confirmed: false,
reservePub: "A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG",
exchangePaytoUris: ["payto://x-taler-bank/bank.demo.taler.net/Exchange"],
@@ -308,6 +309,7 @@ export const WithdrawPendingTalerBankUnconfirmed = tests.createExample(
withdrawalDetails: {
type: WithdrawalType.TalerBankIntegrationApi,
confirmed: false,
+ reserveIsReady: false,
reservePub: "A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG",
bankConfirmationUrl: "http://bank.demo.taler.net",
},
@@ -324,6 +326,7 @@ export const WithdrawPendingTalerBankConfirmed = tests.createExample(
withdrawalDetails: {
type: WithdrawalType.TalerBankIntegrationApi,
confirmed: true,
+ reserveIsReady: false,
reservePub: "A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG",
},
extendedStatus: ExtendedStatus.Pending,