diff options
Diffstat (limited to 'packages/taler-wallet-cli/src')
-rw-r--r-- | packages/taler-wallet-cli/src/harness/harness.ts | 27 | ||||
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/test-payment-on-demo.ts | 1 |
2 files changed, 25 insertions, 3 deletions
diff --git a/packages/taler-wallet-cli/src/harness/harness.ts b/packages/taler-wallet-cli/src/harness/harness.ts index 33f677d94..51f0ce649 100644 --- a/packages/taler-wallet-cli/src/harness/harness.ts +++ b/packages/taler-wallet-cli/src/harness/harness.ts @@ -42,6 +42,8 @@ import { TalerProtocolDuration, } from "@gnu-taler/taler-util"; import { + BankAccessApi, + BankApi, BankServiceHandle, HarnessExchangeBankAccount, NodeHttpLib, @@ -522,11 +524,17 @@ class LibEuFinBankService extends BankServiceBase implements BankServiceHandle { return url.href; } + // FIXME: Duplicate? Where is this needed? get baseUrlAccessApi(): string { let url = new URL("access-api/", this.baseUrlDemobank); return url.href; } + get bankAccessApiBaseUrl(): string { + let url = new URL("access-api/", this.baseUrlDemobank); + return url.href; + } + get baseUrlNetloc(): string { return `http://localhost:${this.bankConfig.httpPort}/`; } @@ -796,10 +804,19 @@ class FakebankService extends BankServiceBase implements BankServiceHandle { return `http://localhost:${this.bankConfig.httpPort}/`; } + get bankAccessApiBaseUrl(): string { + let url = new URL("taler-bank-access/", this.baseUrl); + return url.href; + } + async createExchangeAccount( accountName: string, password: string, ): Promise<HarnessExchangeBankAccount> { + // FIXME: Is there a better place to do this initialization? + await this.start(); + await this.pingUntilAvailable(); + await BankApi.registerAccount(this, accountName, password); return { accountName: accountName, accountPassword: password, @@ -813,6 +830,10 @@ class FakebankService extends BankServiceBase implements BankServiceHandle { } async start(): Promise<void> { + if (this.proc) { + console.log("fakebank already running, not starting again"); + return; + } this.proc = this.globalTestState.spawnService( "taler-fakebank-run", ["-c", this.configFile], @@ -821,13 +842,13 @@ class FakebankService extends BankServiceBase implements BankServiceHandle { } async pingUntilAvailable(): Promise<void> { - const url = `http://localhost:${this.bankConfig.httpPort}/config`; + const url = `http://localhost:${this.bankConfig.httpPort}/taler-bank-integration/config`; await pingProc(this.proc, url, "bank"); } } // Use libeufin bank instead of pybank. -const useLibeufinBank = true; +const useLibeufinBank = false; /** * Return a euFin or a pyBank implementation of @@ -2032,7 +2053,7 @@ export function getPayto(label: string): string { return `payto://iban/SANDBOXX/${getRandomIban( label, )}?receiver-name=${label}`; - return `payto://x-taler-bank/${label}`; + return `payto://x-taler-bank/localhost/${label}`; } function waitMs(ms: number): Promise<void> { diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-on-demo.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-on-demo.ts index 50a18944b..737620ce7 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-on-demo.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-on-demo.ts @@ -34,6 +34,7 @@ export async function runPaymentDemoTest(t: GlobalTestState) { // Withdraw digital cash into the wallet. let bankInterface: BankServiceHandle = { baseUrl: "https://bank.demo.taler.net/", + bankAccessApiBaseUrl: "https://bank.demo.taler.net/", http: new NodeHttpLib(), }; let user = await BankApi.createRandomBankUser(bankInterface); |