summaryrefslogtreecommitdiff
path: root/src/headless
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-05-08 10:13:52 -0300
committerTorsten Grote <t@grobox.de>2020-05-08 10:13:52 -0300
commit122574fe05a7f568d4fa968ff4fcde0c403c8a4d (patch)
tree0e3f98ed83a0a35da03b5b5233287b626285d9c8 /src/headless
parent06aa5abcc7b96236b42fdf33af347f09632b6560 (diff)
downloadwallet-core-122574fe05a7f568d4fa968ff4fcde0c403c8a4d.tar.gz
wallet-core-122574fe05a7f568d4fa968ff4fcde0c403c8a4d.tar.bz2
wallet-core-122574fe05a7f568d4fa968ff4fcde0c403c8a4d.zip
Add test for refund and tip, fix cli testing gen-*-uri
Diffstat (limited to 'src/headless')
-rw-r--r--src/headless/taler-wallet-cli.ts22
1 files changed, 17 insertions, 5 deletions
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,