diff options
Diffstat (limited to 'packages/backend/src/pages/OfferRefund.tsx')
-rw-r--r-- | packages/backend/src/pages/OfferRefund.tsx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/packages/backend/src/pages/OfferRefund.tsx b/packages/backend/src/pages/OfferRefund.tsx index 88be378..db006d3 100644 --- a/packages/backend/src/pages/OfferRefund.tsx +++ b/packages/backend/src/pages/OfferRefund.tsx @@ -44,11 +44,12 @@ import "../css/style.css"; interface Props { refundURI?: string; order_status_url?: string; + qr_code?: string; } function Head({ order_summary }: { order_summary?: string }): VNode { return <Fragment> - <meta http-equiv="content-type" content="text/html; UTF-8" /> + <meta charSet="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <noscript> <meta http-equiv="refresh" content="1" /> @@ -57,7 +58,7 @@ function Head({ order_summary }: { order_summary?: string }): VNode { </Fragment> } -export function OfferRefund({ refundURI, order_status_url }: Props): VNode { +export function OfferRefund({ refundURI, qr_code, order_status_url }: Props): VNode { useEffect(() => { let checkUrl: URL; try { @@ -82,7 +83,7 @@ export function OfferRefund({ refundURI, order_status_url }: Props): VNode { try { const resp = JSON.parse(req.responseText); if (!resp.refund_pending) { - window.location.reload(true); + window.location.reload(); } } catch (e) { console.error("could not parse response:", e); @@ -107,9 +108,7 @@ export function OfferRefund({ refundURI, order_status_url }: Props): VNode { <p> Scan this QR code with your Taler mobile wallet: </p> - <div class="qr"> - {refundURI ? <QR text={refundURI} /> : `{{{ taler_refund_qrcode_svg }}}`} - </div> + <div class="qr" dangerouslySetInnerHTML={{ __html: qr_code ? qr_code : `{{{ taler_refund_qrcode_svg }}}` }} /> <p> <a class="pure-button pure-button-active success" href={refundURI ? refundURI : `{{ taler_refund_uri }}`}> Or open your Taller wallet @@ -133,11 +132,13 @@ export function mount(): void { render(<Head order_summary={os} />, document.head); } - const ru = fromLocation.get('refund_uri') || undefined; + const uri = fromLocation.get('refund_uri') || undefined; const osu = fromLocation.get('order_status_url') || undefined; + const qr_code = uri ? renderToString(<QR text={uri} />) : undefined; render(<OfferRefund - refundURI={ru} order_status_url={osu} + refundURI={uri} order_status_url={osu} + qr_code={qr_code} />, document.body); } catch (e) { console.error("got error", e); |