commit c8302ad5cfbc62bcfea7ab59ca53a837f871416b
parent b230122c9f62c889f297c58451c0fa1d2dad1ebc
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date: Tue, 3 Mar 2020 19:18:29 +0100
CLI: command to query status of payments.
Diffstat:
1 file changed, 21 insertions(+), 0 deletions(-)
diff --git a/sandbox/src/main/python/libeufin-cli b/sandbox/src/main/python/libeufin-cli
@@ -570,6 +570,27 @@ def prepare(ctx, account_id, nexus_base_url):
ctx.invoke(hia, account_id=account_id, nexus_base_url=nexus_base_url)
ctx.invoke(sync, account_id=account_id, nexus_base_url=nexus_base_url)
+@ebics.command(help="Show status of payments")
+@click.pass_context
+@click.option(
+ "--account-id",
+ help="Numerical ID of the customer at the Nexus",
+ required=True
+)
+@click.argument(
+ "nexus-base-url"
+)
+def payment_status(
+ ctx, account_id, nexus_base_url):
+ nexus_url = urljoin(
+ nexus_base_url, "/ebics/subscribers/{}/payments".format(account_id))
+ try:
+ resp = get(nexus_url)
+ except Exception:
+ print("Could not reach the Nexus")
+ return
+
+ print(resp.content.decode("utf-8"))
@ebics.command(help="Prepare a payment")
@click.pass_context