From e87073d42a2f51405d1a1f6be27cb378b552dcdf Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Wed, 11 Jan 2023 15:26:07 -0300
Subject: add kyc warning

---
 .../src/wallet/Transaction.tsx                     | 35 +++++++++++++++++-----
 1 file changed, 28 insertions(+), 7 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/wallet/Transaction.tsx')

diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx
index f22f3b4ee..c6fa9ec68 100644
--- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx
@@ -44,7 +44,7 @@ import emptyImg from "../../static/img/empty.png";
 import { Amount } from "../components/Amount.js";
 import { BankDetailsByPaytoType } from "../components/BankDetailsByPaytoType.js";
 import { CopyButton } from "../components/CopyButton.js";
-import { ErrorAlertView } from "../components/CurrentAlerts.js";
+import { AlertView, ErrorAlertView } from "../components/CurrentAlerts.js";
 import { Loading } from "../components/Loading.js";
 import { Kind, Part, PartCollapsible, PartPayto } from "../components/Part.js";
 import { QR } from "../components/QR.js";
@@ -199,12 +199,33 @@ export function TransactionView({
       <Fragment>
         <section style={{ padding: 8, textAlign: "center" }}>
           {transaction?.error ? (
-            <ErrorAlertView
-              error={alertFromError(
-                i18n.str`There was an error trying to complete the transaction`,
-                transaction.error,
-              )}
-            />
+            transaction.error.code === 7025 ? (
+              <AlertView
+                alert={{
+                  type: "warning",
+                  message: i18n.str`KYC check required for the transaction to complete`,
+                  description:
+                    transaction.error.kycUrl &&
+                    typeof transaction.error.kycUrl === "string" ? (
+                      <div>
+                        <i18n.Translate>
+                          Follow this link to the{` `}
+                          <a href={transaction.error.kycUrl}>KYC verifier</a>
+                        </i18n.Translate>
+                      </div>
+                    ) : (
+                      i18n.str`No more information has been provided`
+                    ),
+                }}
+              />
+            ) : (
+              <ErrorAlertView
+                error={alertFromError(
+                  i18n.str`There was an error trying to complete the transaction`,
+                  transaction.error,
+                )}
+              />
+            )
           ) : undefined}
           {transaction.pending && (
             <WarningBox>
-- 
cgit v1.2.3

