[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] 02/03: open kyc link
From: |
gnunet |
Subject: |
[taler-wallet-core] 02/03: open kyc link |
Date: |
Wed, 21 Aug 2024 15:25:42 +0200 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository wallet-core.
commit 2aaa2e999a034f5020eb8ef4a21a8fe71d92ff74
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Tue Aug 20 12:20:42 2024 -0300
open kyc link
---
packages/kyc-ui/src/pages/FillForm.tsx | 13 ++++++++++++-
packages/kyc-ui/src/pages/Start.tsx | 21 +++++++++++++++++++--
2 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/packages/kyc-ui/src/pages/FillForm.tsx
b/packages/kyc-ui/src/pages/FillForm.tsx
index d5294f0f3..518a89fd4 100644
--- a/packages/kyc-ui/src/pages/FillForm.tsx
+++ b/packages/kyc-ui/src/pages/FillForm.tsx
@@ -16,6 +16,7 @@
import {
AbsoluteTime,
AccessToken,
+ Amounts,
HttpStatusCode,
KycRequirementInformation,
assertUnreachable,
@@ -131,7 +132,17 @@ export function FillForm({
payload: validatedForm,
};
- return lib.exchange.uploadKycForm(reqId, information);
+ const fh = new FormData()
+ // fh.set("header", JSON.stringify(information.header))
+ // fh.set("payload", JSON.stringify(information.payload))
+ Object.entries(validatedForm as
Record<string,string>).forEach(([key, value]) => {
+ if (key === "money") {
+ fh.set(key,Amounts.stringify(value))
+ } else {
+ fh.set(key,(value))
+ }
+ })
+ return lib.exchange.uploadKycForm(reqId, fh);
},
(res) => {
onComplete();
diff --git a/packages/kyc-ui/src/pages/Start.tsx
b/packages/kyc-ui/src/pages/Start.tsx
index c4716f993..e6e7ad1d4 100644
--- a/packages/kyc-ui/src/pages/Start.tsx
+++ b/packages/kyc-ui/src/pages/Start.tsx
@@ -22,8 +22,10 @@ import {
} from "@gnu-taler/taler-util";
import {
Attention,
+ Button,
Loading,
LocalNotificationBanner,
+ useExchangeApiContext,
useLocalNotificationHandler,
useTranslationContext,
} from "@gnu-taler/web-util/browser";
@@ -211,6 +213,18 @@ function RequirementRow({
onFormSelected: () => void;
}): VNode {
const { i18n } = useTranslationContext();
+ const { lib } = useExchangeApiContext();
+ const [notification, withErrorHandler] = useLocalNotificationHandler();
+ const reqId = req.id;
+ const startHandler =
+ !reqId ? undefined :
+ withErrorHandler(
+ async () => {
+ return lib.exchange.startKycProcess(reqId)
+ }, (res) => {
+ window.open(res.body.redirect_url, "_blank")
+ });
+
switch (req.form) {
case "INFO": {
return (
@@ -267,10 +281,13 @@ function RequirementRow({
</div>
<div class="min-w-0 flex-auto">
<p class="text-sm font-semibold leading-6 text-gray-900">
- <a href="#">
+ <Button
+ type="submit"
+ handler={startHandler}
+ >
<span class="absolute inset-x-0 -top-px bottom-0"></span>
<i18n.Translate>Begin KYC process</i18n.Translate>
- </a>
+ </Button>
</p>
<p class="mt-1 flex text-xs leading-5 text-gray-500">
{req.description}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.