aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-05-16 13:21:55 +0200
committerFlorian Dold <florian@dold.me>2024-05-16 13:21:55 +0200
commit26628693c2899098539dd7c7c7ff52b90b656a00 (patch)
tree50da5f91e34e9057b99e46d45ab2633a89e7ab91
parentf0decd3521440d6119ad9333949ce67653d8b2c2 (diff)
downloadwallet-core-26628693c2899098539dd7c7c7ff52b90b656a00.tar.xz
-test
-rw-r--r--packages/taler-harness/src/integrationtests/test-payment-template.ts20
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: {},
},
);