pending #7468
This commit is contained in:
parent
d8088e30da
commit
7fc8d64c90
@ -21,6 +21,7 @@ import {
|
|||||||
AbsoluteTime,
|
AbsoluteTime,
|
||||||
Transaction,
|
Transaction,
|
||||||
TransactionType,
|
TransactionType,
|
||||||
|
WithdrawalType,
|
||||||
} from "@gnu-taler/taler-util";
|
} from "@gnu-taler/taler-util";
|
||||||
import { h, VNode } from "preact";
|
import { h, VNode } from "preact";
|
||||||
import { useTranslationContext } from "../context/translation.js";
|
import { useTranslationContext } from "../context/translation.js";
|
||||||
@ -38,6 +39,7 @@ import { Time } from "./Time.js";
|
|||||||
|
|
||||||
export function TransactionItem(props: { tx: Transaction }): VNode {
|
export function TransactionItem(props: { tx: Transaction }): VNode {
|
||||||
const tx = props.tx;
|
const tx = props.tx;
|
||||||
|
const { i18n } = useTranslationContext();
|
||||||
switch (tx.type) {
|
switch (tx.type) {
|
||||||
case TransactionType.Withdrawal:
|
case TransactionType.Withdrawal:
|
||||||
return (
|
return (
|
||||||
@ -48,7 +50,18 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
|
|||||||
title={new URL(tx.exchangeBaseUrl).hostname}
|
title={new URL(tx.exchangeBaseUrl).hostname}
|
||||||
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
||||||
iconPath={"W"}
|
iconPath={"W"}
|
||||||
pending={tx.pending}
|
pending={
|
||||||
|
tx.pending
|
||||||
|
? tx.withdrawalDetails.type ===
|
||||||
|
WithdrawalType.TalerBankIntegrationApi
|
||||||
|
? !tx.withdrawalDetails.confirmed
|
||||||
|
? i18n.str`Need approval in the Bank`
|
||||||
|
: i18n.str`Exchange is waiting the wire transfer`
|
||||||
|
: undefined
|
||||||
|
: tx.withdrawalDetails.type === WithdrawalType.ManualTransfer
|
||||||
|
? i18n.str`Exchange is waiting the wire transfer`
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.Payment:
|
case TransactionType.Payment:
|
||||||
@ -61,7 +74,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
|
|||||||
subtitle={tx.info.summary}
|
subtitle={tx.info.summary}
|
||||||
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
||||||
iconPath={"P"}
|
iconPath={"P"}
|
||||||
pending={tx.pending}
|
// pending={tx.pending}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.Refund:
|
case TransactionType.Refund:
|
||||||
@ -74,7 +87,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
|
|||||||
title={tx.info.merchant.name}
|
title={tx.info.merchant.name}
|
||||||
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
||||||
iconPath={"R"}
|
iconPath={"R"}
|
||||||
pending={tx.pending}
|
// pending={tx.pending}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.Tip:
|
case TransactionType.Tip:
|
||||||
@ -86,7 +99,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
|
|||||||
title={new URL(tx.merchantBaseUrl).hostname}
|
title={new URL(tx.merchantBaseUrl).hostname}
|
||||||
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
||||||
iconPath={"T"}
|
iconPath={"T"}
|
||||||
pending={tx.pending}
|
// pending={tx.pending}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.Refresh:
|
case TransactionType.Refresh:
|
||||||
@ -98,7 +111,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
|
|||||||
title={new URL(tx.exchangeBaseUrl).hostname}
|
title={new URL(tx.exchangeBaseUrl).hostname}
|
||||||
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
||||||
iconPath={"R"}
|
iconPath={"R"}
|
||||||
pending={tx.pending}
|
// pending={tx.pending}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.Deposit:
|
case TransactionType.Deposit:
|
||||||
@ -110,7 +123,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
|
|||||||
title={tx.targetPaytoUri}
|
title={tx.targetPaytoUri}
|
||||||
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
||||||
iconPath={"D"}
|
iconPath={"D"}
|
||||||
pending={tx.pending}
|
// pending={tx.pending}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.PeerPullCredit:
|
case TransactionType.PeerPullCredit:
|
||||||
@ -122,7 +135,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
|
|||||||
title={tx.info.summary || "Invoice"}
|
title={tx.info.summary || "Invoice"}
|
||||||
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
||||||
iconPath={"I"}
|
iconPath={"I"}
|
||||||
pending={tx.pending}
|
// pending={tx.pending}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.PeerPullDebit:
|
case TransactionType.PeerPullDebit:
|
||||||
@ -134,7 +147,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
|
|||||||
title={tx.info.summary || "Invoice"}
|
title={tx.info.summary || "Invoice"}
|
||||||
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
||||||
iconPath={"I"}
|
iconPath={"I"}
|
||||||
pending={tx.pending}
|
// pending={tx.pending}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.PeerPushCredit:
|
case TransactionType.PeerPushCredit:
|
||||||
@ -146,7 +159,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
|
|||||||
title={tx.info.summary || "Transfer"}
|
title={tx.info.summary || "Transfer"}
|
||||||
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
||||||
iconPath={"T"}
|
iconPath={"T"}
|
||||||
pending={tx.pending}
|
// pending={tx.pending}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case TransactionType.PeerPushDebit:
|
case TransactionType.PeerPushDebit:
|
||||||
@ -158,7 +171,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
|
|||||||
title={tx.info.summary || "Transfer"}
|
title={tx.info.summary || "Transfer"}
|
||||||
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
|
||||||
iconPath={"T"}
|
iconPath={"T"}
|
||||||
pending={tx.pending}
|
// pending={tx.pending}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
default: {
|
default: {
|
||||||
@ -198,7 +211,7 @@ function TransactionLayout(props: TransactionLayoutProps): VNode {
|
|||||||
</LargeText>
|
</LargeText>
|
||||||
{props.pending && (
|
{props.pending && (
|
||||||
<LightText style={{ marginTop: 5, marginBottom: 5 }}>
|
<LightText style={{ marginTop: 5, marginBottom: 5 }}>
|
||||||
<i18n.Translate>Waiting for confirmation</i18n.Translate>
|
<i18n.Translate>{props.pending}</i18n.Translate>
|
||||||
</LightText>
|
</LightText>
|
||||||
)}
|
)}
|
||||||
<SmallLightText style={{ marginTop: 5 }}>
|
<SmallLightText style={{ marginTop: 5 }}>
|
||||||
@ -206,7 +219,7 @@ function TransactionLayout(props: TransactionLayoutProps): VNode {
|
|||||||
</SmallLightText>
|
</SmallLightText>
|
||||||
</Column>
|
</Column>
|
||||||
<TransactionAmount
|
<TransactionAmount
|
||||||
pending={props.pending}
|
pending={props.pending !== undefined}
|
||||||
amount={Amounts.parseOrThrow(props.amount)}
|
amount={Amounts.parseOrThrow(props.amount)}
|
||||||
debitCreditIndicator={props.debitCreditIndicator}
|
debitCreditIndicator={props.debitCreditIndicator}
|
||||||
/>
|
/>
|
||||||
@ -222,7 +235,7 @@ interface TransactionLayoutProps {
|
|||||||
subtitle?: string;
|
subtitle?: string;
|
||||||
id: string;
|
id: string;
|
||||||
iconPath: string;
|
iconPath: string;
|
||||||
pending: boolean;
|
pending?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TransactionAmountProps {
|
interface TransactionAmountProps {
|
||||||
|
@ -341,8 +341,7 @@ export function TransactionView({
|
|||||||
<InfoBox>
|
<InfoBox>
|
||||||
<div style={{ display: "block" }}>
|
<div style={{ display: "block" }}>
|
||||||
<i18n.Translate>
|
<i18n.Translate>
|
||||||
The bank did not yet confirmed the wire transfer. Go to the
|
Wire transfer need a confirmation. Go to the
|
||||||
{` `}
|
|
||||||
<a
|
<a
|
||||||
href={transaction.withdrawalDetails.bankConfirmationUrl}
|
href={transaction.withdrawalDetails.bankConfirmationUrl}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -351,7 +350,8 @@ export function TransactionView({
|
|||||||
>
|
>
|
||||||
<i18n.Translate>bank site</i18n.Translate>
|
<i18n.Translate>bank site</i18n.Translate>
|
||||||
</a>{" "}
|
</a>{" "}
|
||||||
and check there is no pending step.
|
and check wire transfer operation to exchange account is
|
||||||
|
complete.
|
||||||
</i18n.Translate>
|
</i18n.Translate>
|
||||||
</div>
|
</div>
|
||||||
</InfoBox>
|
</InfoBox>
|
||||||
|
Loading…
Reference in New Issue
Block a user