diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-09-06 11:06:28 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-09-06 11:06:28 +0200 |
commit | f6c01085113dfb004ca4478f276cfef0d2c24138 (patch) | |
tree | c28ccddf3804b7467fdbeb04d849c44d776de6bc /src/webex | |
parent | 9297bbc8253650a2530afc3fd88c9bd102de0793 (diff) |
fix bug #5373: only allow existing payment redirection for contracts from the same merchant
Diffstat (limited to 'src/webex')
-rw-r--r-- | src/webex/pages/pay.tsx | 6 |
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); |