diff options
author | MS <ms@taler.net> | 2021-08-16 23:21:35 -1100 |
---|---|---|
committer | MS <ms@taler.net> | 2021-08-16 23:21:35 -1100 |
commit | 93b455a28aa949bdbed2672731cbbbc7c99a87b8 (patch) | |
tree | 90ed515039b126f7bf0d2810bfde38a0f8c16299 /packages | |
parent | 1f255b7f4e0225b1eede71bf7d67ca4b01c2aea4 (diff) |
Anastasis API helper function.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/libeufin.ts | 18 | ||||
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts | 13 |
2 files changed, 31 insertions, 0 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts b/packages/taler-wallet-cli/src/integrationtests/libeufin.ts index 71c7aad64..f9266a39d 100644 --- a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts +++ b/packages/taler-wallet-cli/src/integrationtests/libeufin.ts @@ -1157,6 +1157,24 @@ export namespace LibeufinNexusApi { let response = await axios.get(url.href); } + // Uses the Anastasis API to get a list of transactions. + export async function getAnastasisTransactions( + libeufinNexusService: LibeufinNexusService, + anastasisBaseUrl: string, + params: {}, // of the request: {delta: 5, ..} + username: string = "admin", + password: string = "test", + ): Promise<any> { + let url = new URL("/history/incoming", anastasisBaseUrl); + let response = await axios.get(url.href, { params: params, + auth: { + username: username, + password: password, + }, + }); + return response; + } + // FIXME: this function should return some structured // object that represents a history. export async function getAccountTransactions( diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts index f412ab8e4..528d398ac 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-facade-anastasis.ts @@ -23,6 +23,7 @@ import { NexusUserBundle, launchLibeufinServices, LibeufinNexusApi, + LibeufinSandboxApi, } from "./libeufin"; /** @@ -58,6 +59,18 @@ export async function runLibeufinApiFacadeTest(t: GlobalTestState) { t.assertTrue(anastasisBaseUrl.startsWith("http://")); t.assertTrue(anastasisBaseUrl.endsWith("/")); + LibeufinSandboxApi.simulateIncomingTransaction( + libeufinServices.libeufinSandbox, + user01nexus.localAccountName, + { + debtorIban: "ES3314655813489414469157", + debtorBic: "BCMAESM1XXX", + debtorName: "Mock Donor", + subject: "Anastasis donation", + amount: "EUR:3", + }, + ) + //***************************************// // Here payments need to be generated // // and checked via the Anastasis facade. // |