diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-08-12 16:32:07 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-08-12 16:32:07 +0530 |
commit | 11fa3397053c16cfcbf594c1389a75eaad94a40e (patch) | |
tree | 2a464ac389576b8a81021d92ee4ec3d2d6e8f56b /packages/taler-integrationtests/src/test-payment.ts | |
parent | 8d7b171d02e0ab4d5da7dc81eaea6c27106dbc57 (diff) | |
download | wallet-core-11fa3397053c16cfcbf594c1389a75eaad94a40e.tar.gz wallet-core-11fa3397053c16cfcbf594c1389a75eaad94a40e.tar.bz2 wallet-core-11fa3397053c16cfcbf594c1389a75eaad94a40e.zip |
fix preparePay bug and add integration test for it
Diffstat (limited to 'packages/taler-integrationtests/src/test-payment.ts')
-rw-r--r-- | packages/taler-integrationtests/src/test-payment.ts | 8 |
1 files changed, 5 insertions, 3 deletions
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"); |