taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit bd80547962c7913269946808f84aa69afce434bb
parent f7493767dcfdf2d7e4bd4ee445b424b862f38180
Author: Florian Dold <florian@dold.me>
Date:   Fri,  3 Jul 2026 20:06:41 +0200

harness: add --discount-name argument to advanced-tokens-1 playground

Diffstat:
Mpackages/taler-harness/src/index.ts | 2++
Mpackages/taler-harness/src/playground.ts | 12+++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/packages/taler-harness/src/index.ts b/packages/taler-harness/src/index.ts @@ -1799,11 +1799,13 @@ playgroundCli .requiredOption("merchantUrl", ["--merchant-url"], clk.STRING) .requiredOption("merchantPw", ["--merchant-pw"], clk.STRING) .maybeOption("continueFamily", ["--continue"], clk.STRING) + .maybeOption("discountName", ["--discount-name"], clk.STRING) .action(async (args) => { await runPlaygroundAdvancedTokens1({ merchantPw: args.exp.merchantPw, merchantUrl: args.exp.merchantUrl, continueFamily: args.exp.continueFamily, + discountName: args.exp.discountName, }); }); diff --git a/packages/taler-harness/src/playground.ts b/packages/taler-harness/src/playground.ts @@ -126,6 +126,10 @@ export interface PlaygroundAdvancedTokensArgs { * If specified, continue with the given token family suffix. */ continueFamily?: string; + /** + * Name suffix for the discount token. + */ + discountName?: string; } export async function runPlaygroundAdvancedTokens1( @@ -156,9 +160,11 @@ export async function runPlaygroundAdvancedTokens1( const slugDiscount1 = `slugdiscount1-${suffix}`; const slugSubscription1 = `slugsubscription1-${suffix}`; + let discountName = args.discountName ?? "Test"; + if (args.continueFamily == null) { await merchantClient.createTokenFamily(tok.access_token, { - name: "discount1", + name: discountName, slug: slugDiscount1, description: "My Discount 1 (valid two minutes)", duration: Duration.toTalerProtocolDuration( @@ -219,7 +225,7 @@ export async function runPlaygroundAdvancedTokens1( }, { amount: `${config.currency}:3` as AmountString, - description: "Article and 3 discounts", + description: `Article and 3 ${discountName} discounts`, description_i18n: { de: "Artikel und 3 Discounts", }, @@ -246,7 +252,7 @@ export async function runPlaygroundAdvancedTokens1( }, { amount: articleDiscountedAmount, - description: "Pay half with a discount1 token", + description: `Pay half with a ${discountName} token`, inputs: [ { type: OrderInputType.Token,