From 26628693c2899098539dd7c7c7ff52b90b656a00 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 16 May 2024 13:21:55 +0200 Subject: -test --- .../src/integrationtests/test-payment-template.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/taler-harness/src/integrationtests/test-payment-template.ts b/packages/taler-harness/src/integrationtests/test-payment-template.ts index fb69f2571..451a7dbe9 100644 --- a/packages/taler-harness/src/integrationtests/test-payment-template.ts +++ b/packages/taler-harness/src/integrationtests/test-payment-template.ts @@ -43,6 +43,8 @@ export async function runPaymentTemplateTest(t: GlobalTestState) { const merchantClient = new MerchantApiClient(merchant.makeInstanceBaseUrl()); + const mySummary = "hello, I'm a summary"; + const createTemplateRes = await merchantClient.createTemplate({ template_id: "template1", template_description: "my test template", @@ -53,7 +55,7 @@ export async function runPaymentTemplateTest(t: GlobalTestState) { minutes: 2, }), ), - summary: "hello, I'm a summary", + summary: mySummary, }, editable_defaults: { amount: "TESTKUDOS:1" as AmountString, @@ -71,12 +73,26 @@ export async function runPaymentTemplateTest(t: GlobalTestState) { }); await wres.withdrawalFinishedCond; + const talerPayTemplateUri = `taler+http://pay-template/localhost:${merchant.port}/template1`; + + const checkPayTemplateResult = await walletClient.call( + WalletApiOperation.CheckPayForTemplate, + { + talerPayTemplateUri, + }, + ); + + t.assertDeepEqual( + checkPayTemplateResult.template_contract.summary, + mySummary, + ); + // Request a template payment const preparePayResult = await walletClient.call( WalletApiOperation.PreparePayForTemplate, { - talerPayTemplateUri: `taler+http://pay-template/localhost:${merchant.port}/template1`, + talerPayTemplateUri, templateParams: {}, }, ); -- cgit v1.2.3