From 43655adff0f8f1db082e1f0c18f1271a29ab8905 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 28 Jul 2020 15:18:01 +0530 Subject: updated preparePay API according to spec --- src/webex/pages/pay.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/webex/pages/pay.tsx') diff --git a/src/webex/pages/pay.tsx b/src/webex/pages/pay.tsx index a69b6b766..87f3c83d3 100644 --- a/src/webex/pages/pay.tsx +++ b/src/webex/pages/pay.tsx @@ -24,7 +24,7 @@ */ import * as i18n from "../i18n"; -import { PreparePayResult } from "../../types/walletTypes"; +import { PreparePayResult, PreparePayResultType } from "../../types/walletTypes"; import { renderAmount, ProgressButton } from "../renderHtml"; import * as wxApi from "../wxApi"; @@ -58,15 +58,11 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }): JSX.Element { insufficientBalance = true; } - if (payStatus.status === "error") { - return Error: {payStatus.error}; - } - if (payStatus.status === "payment-possible") { totalFees = payStatus.totalFees; } - if (payStatus.status === "paid" && numTries === 0) { + if (payStatus.status === PreparePayResultType.AlreadyConfirmed && numTries === 0) { return ( You have already paid for this article. Click{" "} -- cgit v1.2.3