commit 4604a46031933edd78380a4782c318574ce2b8bd
parent 7621403ad40a5b6a3725b01ce7c91b9dfa906b8c
Author: MS <ms@taler.net>
Date: Wed, 15 Jun 2022 09:24:54 +0200
cli
add 'demobank' command to list transactions
Diffstat:
1 file changed, 22 insertions(+), 0 deletions(-)
diff --git a/cli/bin/libeufin-cli b/cli/bin/libeufin-cli
@@ -1206,6 +1206,28 @@ def sandbox_bankaccount(ctx):
def sandbox_demobank(ctx):
pass
+@sandbox_demobank.command("list-transactions", help="List transactions.")
+@click.option(
+ "--bank-account",
+ help="Label of the bank account to be debited for the transaction.",
+ required=True
+)
+@click.pass_obj
+def sandbox_demobank_list_transactions(obj, bank_account):
+ url = obj.access_api_url (f"/accounts/{bank_account}/transactions")
+ try:
+ resp = get(
+ url,
+ auth=auth.HTTPBasicAuth(obj.username, obj.password),
+ )
+ except Exception as e:
+ print(e)
+ print("Could not reach sandbox at " + url)
+ exit(1)
+
+ tell_user(resp, withsuccess=True)
+
+
@sandbox_demobank.command("new-transaction", help="Initiate a new transaction.")
@click.option(
"--bank-account",