diff --git a/packages/taler-wallet-webextension/src/cta/Pay.tsx b/packages/taler-wallet-webextension/src/cta/Pay.tsx index c0fcca169..427a3a715 100644 --- a/packages/taler-wallet-webextension/src/cta/Pay.tsx +++ b/packages/taler-wallet-webextension/src/cta/Pay.tsx @@ -40,7 +40,7 @@ import { } from "@gnu-taler/taler-util"; import { OperationFailedError } from "@gnu-taler/taler-wallet-core"; import { Fragment, h, VNode } from "preact"; -import { useState } from "preact/hooks"; +import { useEffect, useState } from "preact/hooks"; import { Loading } from "../components/Loading"; import { LoadingError } from "../components/LoadingError"; import { LogoHeader } from "../components/LogoHeader"; @@ -161,6 +161,20 @@ export function PaymentRequestView({ let totalFees: AmountJson = Amounts.getZero(payStatus.amountRaw); const contractTerms: ContractTerms = payStatus.contractTerms; + useEffect(() => { + if ( + payStatus.status === PreparePayResultType.AlreadyConfirmed && + payStatus.paid + ) { + const fu = payStatus.contractTerms.fulfillment_url; + if (fu) { + setTimeout(() => { + document.location.href = fu; + }, 3000); + } + } + }); + if (!contractTerms) { return ( @@ -281,7 +295,16 @@ export function PaymentRequestView({

{i18n.str`Digital cash payment`}

{payStatus.status === PreparePayResultType.AlreadyConfirmed && (payStatus.paid ? ( - Already paid + payStatus.contractTerms.fulfillment_url ? ( + + Already paid, you are going to be redirected to{" "} + + {payStatus.contractTerms.fulfillment_url} + + + ) : ( + Already paid + ) ) : ( Already claimed ))}