diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatePage.tsx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatePage.tsx index 0d2bb2c30..e46941b6d 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatePage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatePage.tsx @@ -36,6 +36,7 @@ import { URL_REGEX, } from "../../../../utils/constants.js"; import { useBackendBaseRequest } from "../../../../hooks/backend.js"; +import { parsePaytoUri } from "@gnu-taler/taler-util"; type Entity = MerchantBackend.Rewards.ReserveCreateRequest; @@ -129,16 +130,18 @@ function ViewStep({ return Promise.resolve(); } - return request<any>(reserve.exchange_url, "keys") //</div>fetch(`${reserve.exchange_url}wire`) + return request<any>(reserve.exchange_url, "keys") .then((r) => { + console.log(r) if (r.loading) return; if (r.ok) { const wireMethods = r.data.accounts.map((a: any) => { - const match = PAYTO_WIRE_METHOD_LOOKUP.exec(a.payto_uri); - return (match && match[1]) || ""; - }); + const p = parsePaytoUri(a.payto_uri); + const r = p?.targetType + return r + }).filter((x:any) => !!x); + setWireMethods(Array.from(new Set(wireMethods))); } - setWireMethods(wireMethods); setCurrentStep(Steps.WIRE_METHOD); return; }) |