[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: if order has been paid, redir
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: if order has been paid, redirect to the fulfillment_url |
Date: |
Mon, 31 Jan 2022 03:33:04 +0100 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new c47311b4 if order has been paid, redirect to the fulfillment_url
c47311b4 is described below
commit c47311b4a70d384d08389959c50faa2a6e7d0e91
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Sun Jan 30 23:32:56 2022 -0300
if order has been paid, redirect to the fulfillment_url
---
packages/taler-wallet-webextension/src/cta/Pay.tsx | 27 ++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/packages/taler-wallet-webextension/src/cta/Pay.tsx
b/packages/taler-wallet-webextension/src/cta/Pay.tsx
index c0fcca16..427a3a71 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 (
<span>
@@ -281,7 +295,16 @@ export function PaymentRequestView({
<h2>{i18n.str`Digital cash payment`}</h2>
{payStatus.status === PreparePayResultType.AlreadyConfirmed &&
(payStatus.paid ? (
- <SuccessBox> Already paid </SuccessBox>
+ payStatus.contractTerms.fulfillment_url ? (
+ <SuccessBox>
+ Already paid, you are going to be redirected to{" "}
+ <a href={payStatus.contractTerms.fulfillment_url}>
+ {payStatus.contractTerms.fulfillment_url}
+ </a>
+ </SuccessBox>
+ ) : (
+ <SuccessBox> Already paid </SuccessBox>
+ )
) : (
<WarningBox> Already claimed </WarningBox>
))}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: if order has been paid, redirect to the fulfillment_url,
gnunet <=