diff options
author | Florian Dold <florian@dold.me> | 2024-05-16 13:21:55 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-05-16 13:21:55 +0200 |
commit | 26628693c2899098539dd7c7c7ff52b90b656a00 (patch) | |
tree | 50da5f91e34e9057b99e46d45ab2633a89e7ab91 /packages/taler-harness | |
parent | f0decd3521440d6119ad9333949ce67653d8b2c2 (diff) | |
download | wallet-core-26628693c2899098539dd7c7c7ff52b90b656a00.tar.xz |
-test
Diffstat (limited to 'packages/taler-harness')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-payment-template.ts | 20 |
1 files 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: {}, }, ); |