From 11fa3397053c16cfcbf594c1389a75eaad94a40e Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 12 Aug 2020 16:32:07 +0530 Subject: fix preparePay bug and add integration test for it --- packages/taler-integrationtests/src/test-payment.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'packages/taler-integrationtests/src/test-payment.ts') diff --git a/packages/taler-integrationtests/src/test-payment.ts b/packages/taler-integrationtests/src/test-payment.ts index 3fd879580..77645909c 100644 --- a/packages/taler-integrationtests/src/test-payment.ts +++ b/packages/taler-integrationtests/src/test-payment.ts @@ -19,6 +19,7 @@ */ import { runTest, GlobalTestState } from "./harness"; import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; +import { PreparePayResultType } from "taler-wallet-core"; /** * Run test for basic, bank-integrated withdrawal. @@ -56,14 +57,15 @@ runTest(async (t: GlobalTestState) => { // Make wallet pay for the order - const r1 = await wallet.apiRequest("preparePay", { + const preparePayResult = await wallet.preparePay({ talerPayUri: orderStatus.taler_pay_uri, }); - t.assertTrue(r1.type === "response"); + + t.assertTrue(preparePayResult.status === PreparePayResultType.PaymentPossible); const r2 = await wallet.apiRequest("confirmPay", { // FIXME: should be validated, don't cast! - proposalId: (r1.result as any).proposalId, + proposalId: preparePayResult.proposalId, }); t.assertTrue(r2.type === "response"); -- cgit v1.2.3