From 122574fe05a7f568d4fa968ff4fcde0c403c8a4d Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Fri, 8 May 2020 10:13:52 -0300 Subject: Add test for refund and tip, fix cli testing gen-*-uri --- src/headless/taler-wallet-cli.ts | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/headless') diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts index 3da01a2dd..483a9e7ce 100644 --- a/src/headless/taler-wallet-cli.ts +++ b/src/headless/taler-wallet-cli.ts @@ -623,12 +623,18 @@ testCli .requiredOption("amount", ["-a", "--amount"], clk.STRING, { default: "TESTKUDOS:10", }) + .maybeOption("merchant", ["-m", "--merchant"], clk.STRING, { + default: "https://backend.test.taler.net/", + }) + .maybeOption("merchantApiKey", ["-k", "--merchant-api-key"], clk.STRING, { + default: "sandbox", + }) .action(async (args) => { const merchantBackend = new MerchantBackendConnection( - "https://backend.test.taler.net/", - "sandbox", + args.genTipUri.merchant ?? "https://backend.test.taler.net/", + args.genTipUri.merchantApiKey ?? "sandbox", ); - const tipUri = await merchantBackend.authorizeTip("TESTKUDOS:10", "test"); + const tipUri = await merchantBackend.authorizeTip(args.genTipUri.amount, "test"); console.log(tipUri); }); @@ -662,11 +668,17 @@ testCli .requiredOption("summary", ["-s", "--summary"], clk.STRING, { default: "Test Payment (for refund)", }) + .maybeOption("merchant", ["-m", "--merchant"], clk.STRING, { + default: "https://backend.test.taler.net/", + }) + .maybeOption("merchantApiKey", ["-k", "--merchant-api-key"], clk.STRING, { + default: "sandbox", + }) .action(async (args) => { const cmdArgs = args.genRefundUri; const merchantBackend = new MerchantBackendConnection( - "https://backend.test.taler.net/", - "sandbox", + cmdArgs.merchant ?? "https://backend.test.taler.net/", + cmdArgs.merchantApiKey ?? "sandbox", ); const orderResp = await merchantBackend.createOrder( cmdArgs.amount, -- cgit v1.2.3