diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-08-11 17:32:11 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-08-11 17:32:11 +0530 |
commit | ff3f96566151d390462931574184ed9e6b84db5b (patch) | |
tree | c8616b7acbe6f8a7ccdcd069de0ac9a3b0741df7 /packages/taler-wallet-webextension | |
parent | 172a51a43a5cfebd06876206ec3a0cd75ad86e43 (diff) |
towards the improved confirmPay API
Diffstat (limited to 'packages/taler-wallet-webextension')
-rw-r--r-- | packages/taler-wallet-webextension/src/pages/pay.tsx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/taler-wallet-webextension/src/pages/pay.tsx b/packages/taler-wallet-webextension/src/pages/pay.tsx index 2abd423bd..b876a9c58 100644 --- a/packages/taler-wallet-webextension/src/pages/pay.tsx +++ b/packages/taler-wallet-webextension/src/pages/pay.tsx @@ -109,6 +109,9 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }): JSX.Element { try { setLoading(true); const res = await wxApi.confirmPay(proposalId, undefined); + if (res.type !== walletTypes.ConfirmPayResultType.Done) { + throw Error("payment pending"); + } document.location.href = res.nextUrl; } catch (e) { console.error(e); |