summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-08-11 17:32:11 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-08-11 17:32:11 +0530
commitff3f96566151d390462931574184ed9e6b84db5b (patch)
treec8616b7acbe6f8a7ccdcd069de0ac9a3b0741df7 /packages/taler-wallet-core/src/operations
parent172a51a43a5cfebd06876206ec3a0cd75ad86e43 (diff)
downloadwallet-core-ff3f96566151d390462931574184ed9e6b84db5b.tar.gz
wallet-core-ff3f96566151d390462931574184ed9e6b84db5b.tar.bz2
wallet-core-ff3f96566151d390462931574184ed9e6b84db5b.zip
towards the improved confirmPay API
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r--packages/taler-wallet-core/src/operations/pay.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay.ts b/packages/taler-wallet-core/src/operations/pay.ts
index fd997fb14..db5a56d18 100644
--- a/packages/taler-wallet-core/src/operations/pay.ts
+++ b/packages/taler-wallet-core/src/operations/pay.ts
@@ -49,6 +49,7 @@ import {
PreparePayResult,
RefreshReason,
PreparePayResultType,
+ ConfirmPayResultType,
} from "../types/walletTypes";
import * as Amounts from "../util/amounts";
import { AmountJson } from "../util/amounts";
@@ -853,7 +854,10 @@ export async function submitPay(
lastSessionId: sessionId,
};
- return { nextUrl };
+ return {
+ type: ConfirmPayResultType.Done,
+ nextUrl,
+ };
}
/**
@@ -957,6 +961,9 @@ export async function preparePayForUri(
await tx.put(Stores.purchases, p);
});
const r = await submitPay(ws, proposalId);
+ if (r.type !== ConfirmPayResultType.Done) {
+ throw Error("submitting pay failed");
+ }
return {
status: PreparePayResultType.AlreadyConfirmed,
contractTerms: JSON.parse(purchase.contractTermsRaw),