aboutsummaryrefslogtreecommitdiff
path: root/src/webex/pages/pay.tsx
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-12-02 00:42:40 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-12-02 00:42:40 +0100
commite1369ff7e8fc02116b9c4261036f0e42e3423cf4 (patch)
treec621067ebda8977a888bfed34b7bbecf64b3b0f0 /src/webex/pages/pay.tsx
parentaaf7e1338d6cdb1b4e01ad318938b3eaea2f922b (diff)
downloadwallet-core-e1369ff7e8fc02116b9c4261036f0e42e3423cf4.tar.xz
the giant refactoring: split wallet into multiple parts
Diffstat (limited to 'src/webex/pages/pay.tsx')
-rw-r--r--src/webex/pages/pay.tsx13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/webex/pages/pay.tsx b/src/webex/pages/pay.tsx
index 7f2a174b7..cff2f9461 100644
--- a/src/webex/pages/pay.tsx
+++ b/src/webex/pages/pay.tsx
@@ -30,9 +30,8 @@ import { renderAmount, ProgressButton, registerMountPage } from "../renderHtml";
import * as wxApi from "../wxApi";
import React, { useState, useEffect } from "react";
-import URI = require("urijs");
-import * as Amounts from "../../amounts";
+import * as Amounts from "../../util/amounts";
function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
const [payStatus, setPayStatus] = useState<PreparePayResult | undefined>();
@@ -164,10 +163,10 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
}
registerMountPage(() => {
- const url = new URI(document.location.href);
- const query: any = URI.parseQuery(url.query());
-
- let talerPayUri = query.talerPayUri;
-
+ const url = new URL(document.location.href);
+ const talerPayUri = url.searchParams.get("talerPayUri");
+ if (!talerPayUri) {
+ throw Error("invalid parameter");
+ }
return <TalerPayDialog talerPayUri={talerPayUri} />;
});