summaryrefslogtreecommitdiff
path: root/src/webex/pages
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-09-06 11:06:28 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-09-06 11:06:28 +0200
commitf6c01085113dfb004ca4478f276cfef0d2c24138 (patch)
treec28ccddf3804b7467fdbeb04d849c44d776de6bc /src/webex/pages
parent9297bbc8253650a2530afc3fd88c9bd102de0793 (diff)
downloadwallet-core-f6c01085113dfb004ca4478f276cfef0d2c24138.tar.gz
wallet-core-f6c01085113dfb004ca4478f276cfef0d2c24138.tar.bz2
wallet-core-f6c01085113dfb004ca4478f276cfef0d2c24138.zip
fix bug #5373: only allow existing payment redirection for contracts from the same merchant
Diffstat (limited to 'src/webex/pages')
-rw-r--r--src/webex/pages/pay.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/webex/pages/pay.tsx b/src/webex/pages/pay.tsx
index 9041f5d1c..579688db3 100644
--- a/src/webex/pages/pay.tsx
+++ b/src/webex/pages/pay.tsx
@@ -92,10 +92,14 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
);
const doPayment = async () => {
+ if (payStatus.status !== "payment-possible") {
+ throw Error("invalid state");
+ }
+ const proposalId = payStatus.proposalId;
setNumTries(numTries + 1);
try {
setLoading(true);
- const res = await wxApi.confirmPay(payStatus!.proposalId!, undefined);
+ const res = await wxApi.confirmPay(proposalId, undefined);
document.location.href = res.nextUrl;
} catch (e) {
console.error(e);