[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: Fetching transactions from the bank.
From: |
gnunet |
Subject: |
[libeufin] branch master updated: Fetching transactions from the bank. |
Date: |
Mon, 10 Jul 2023 14:29:09 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 0c6663d7 Fetching transactions from the bank.
0c6663d7 is described below
commit 0c6663d76ac97a741c47a710dd3def40c0921021
Author: MS <ms@taler.net>
AuthorDate: Mon Jul 10 14:28:30 2023 +0200
Fetching transactions from the bank.
The CLI gives the options to select a time frame.
---
cli/bin/libeufin-cli | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/cli/bin/libeufin-cli b/cli/bin/libeufin-cli
index a9a8a82c..dda58c91 100755
--- a/cli/bin/libeufin-cli
+++ b/cli/bin/libeufin-cli
@@ -957,19 +957,26 @@ def delete_payment(obj, account_name, payment_uuid):
@click.option(
"--range-type",
default="all",
- help="Admitted values: all, latest, previous-days, since-last",
+ help="Admitted values: all, latest, previous-days, since-last, time-frame",
)
@click.option("--level", default="all", help="Admitted values: report,
statement, all")
+@click.option("--start", help="If --range-type is 'time-frame', this option
holds the (inclusive) starting date in the format YYYY-MM-DD. If missing, it
defaults to 1970-01-01.")
+@click.option("--end", help="If --range-type is 'time-frame', this option
holds the (inclusive) ending date in the format YYYY-MM-DD. If missing, it
defaults to the present date.")
@click.argument("account-name")
@click.pass_obj
-def fetch_transactions(obj, account_name, range_type, level):
+def fetch_transactions(obj, account_name, range_type, level, start, end):
url = urljoin_nodrop(
obj.nexus_base_url,
"/bank-accounts/{}/fetch-transactions".format(account_name)
)
+ body = dict(rangeType=range_type, level=level)
+ if range_type == "time-frame":
+ start_value = start if start else "1970-01-01"
+ end_value = end if end else datetime.today().strftime("%Y-%m-%d")
+ body.update(dict(start=start_value, end=end_value))
try:
resp = requests.post(
url,
- json=dict(rangeType=range_type, level=level),
+ json=body,
auth=auth.HTTPBasicAuth(obj.username, obj.password),
)
except Exception as e:
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libeufin] branch master updated: Fetching transactions from the bank.,
gnunet <=