diff options
author | MS <ms@taler.net> | 2021-02-05 14:36:10 +0100 |
---|---|---|
committer | MS <ms@taler.net> | 2021-02-05 14:36:10 +0100 |
commit | dab052673c0fc3eab7330a77feff8767af0c672e (patch) | |
tree | d6de20fd2c028ee31e9262a4c9841b733c98e9a5 /packages | |
parent | 08bd143424deb9a79f131ba1c7968409f5866d63 (diff) | |
download | wallet-core-dab052673c0fc3eab7330a77feff8767af0c672e.tar.xz |
libeufin tutorial: asking downloaded transactions
Diffstat (limited to 'packages')
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/libeufin.ts | 90 | ||||
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts | 16 |
2 files changed, 106 insertions, 0 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts b/packages/taler-wallet-cli/src/integrationtests/libeufin.ts index f84b7b982..b45b8a2a7 100644 --- a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts +++ b/packages/taler-wallet-cli/src/integrationtests/libeufin.ts @@ -89,6 +89,12 @@ export interface LibeufinKeyLetterDetails { connectionName: string; } +export interface LibeufinBankAccountImportDetails { + offeredBankAccountName: string; + nexusBankAccountName: string; + connectionName: string; +} + export class LibeufinSandboxService implements LibeufinSandboxServiceInterface { static async create( gc: GlobalTestState, @@ -386,6 +392,90 @@ export class LibeufinCli { ); console.log(stdout); } + + async downloadBankAccounts(connectionName: string): Promise<void> { + const stdout = await sh( + this.globalTestState, + "libeufin-cli-downloadbankaccounts", + `libeufin-cli connections download-bank-accounts ${connectionName}`, + { + ...process.env, + LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl, + LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username, + LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password, + }, + ); + console.log(stdout); + } + + async listOfferedBankAccounts(connectionName: string): Promise<void> { + const stdout = await sh( + this.globalTestState, + "libeufin-cli-listofferedbankaccounts", + `libeufin-cli connections list-offered-bank-accounts ${connectionName}`, + { + ...process.env, + LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl, + LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username, + LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password, + }, + ); + console.log(stdout); + } + + async importBankAccount( + importDetails: LibeufinBankAccountImportDetails + ): Promise<void> { + + const stdout = await sh( + this.globalTestState, + "libeufin-cli-importbankaccount", + "libeufin-cli connections import-bank-account" + + ` --offered-account-id=${importDetails.offeredBankAccountName}` + + ` --nexus-bank-account-id=${importDetails.nexusBankAccountName}` + + ` ${importDetails.connectionName}`, + { + ...process.env, + LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl, + LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username, + LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password, + }, + ); + console.log(stdout); + } + + async fetchTransactions(bankAccountName: string): Promise<void> { + + const stdout = await sh( + this.globalTestState, + "libeufin-cli-fetchtransactions", + `libeufin-cli accounts fetch-transactions ${bankAccountName}`, + { + ...process.env, + LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl, + LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username, + LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password, + }, + ); + console.log(stdout); + } + + async transactions(bankAccountName: string): Promise<void> { + + const stdout = await sh( + this.globalTestState, + "libeufin-cli-transactions", + `libeufin-cli accounts transactions ${bankAccountName}`, + { + ...process.env, + LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl, + LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username, + LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password, + }, + ); + console.log(stdout); + } + } export namespace LibeufinSandboxApi { diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts index 0b4cc0f89..1b0f86ae5 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-tutorial.ts @@ -95,4 +95,20 @@ export async function runLibeufinTutorialTest(t: GlobalTestState) { connectionName: connectionDetails.connectionName, }); await libeufinCli.connect(connectionDetails.connectionName); + await libeufinCli.downloadBankAccounts(connectionDetails.connectionName); + await libeufinCli.listOfferedBankAccounts(connectionDetails.connectionName); + + const bankAccountImportDetails = { + offeredBankAccountName: bankAccountDetails.accountName, + nexusBankAccountName: "at-nexus-testacct01", + connectionName: connectionDetails.connectionName, + }; + + await libeufinCli.importBankAccount(bankAccountImportDetails); + await libeufinCli.fetchTransactions( + bankAccountImportDetails.nexusBankAccountName + ); + await libeufinCli.transactions( + bankAccountImportDetails.nexusBankAccountName + ); } |