From 509011f9bca5c0693102b780fa782e910217f1ae Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 23 Jan 2023 08:15:22 -0300 Subject: fix payto --- .../paths/instance/reserves/create/CreatedSuccessfully.tsx | 9 ++++++++- .../src/paths/instance/reserves/details/DetailPage.tsx | 14 ++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'packages/merchant-backoffice-ui/src/paths/instance/reserves') diff --git a/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatedSuccessfully.tsx b/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatedSuccessfully.tsx index 92427f3dc..b82907122 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatedSuccessfully.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/reserves/create/CreatedSuccessfully.tsx @@ -14,6 +14,7 @@ GNU Taler; see the file COPYING. If not, see */ +import { parsePaytoUri, stringifyPaytoUri } from "@gnu-taler/taler-util"; import { useTranslationContext } from "@gnu-taler/web-util/lib/index.browser"; import { h, VNode } from "preact"; import { QR } from "../../../../components/exception/QR.js"; @@ -36,7 +37,13 @@ export function CreatedSuccessfully({ onConfirm, onCreateAnother, }: Props): VNode { - const link = `${entity.response.payto_uri}?message=${entity.response.reserve_pub}&amount=${entity.request.initial_balance}`; + const p = parsePaytoUri(entity.response.payto_uri); + if (p) { + p.params["message"] = entity.response.reserve_pub; + p.params["amount"] = entity.request.initial_balance; + } + + const link = !p ? entity.response.payto_uri : stringifyPaytoUri(p); const { i18n } = useTranslationContext(); return (