gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: Python logic to prepare payments.


From: gnunet
Subject: [libeufin] branch master updated: Python logic to prepare payments.
Date: Tue, 03 Mar 2020 16:58:19 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 92829a9  Python logic to prepare payments.
92829a9 is described below

commit 92829a9d53a2605882b2747ea217fd01e5030256
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Mar 3 16:58:01 2020 +0100

    Python logic to prepare payments.
---
 sandbox/src/main/python/libeufin-cli | 61 ++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/sandbox/src/main/python/libeufin-cli 
b/sandbox/src/main/python/libeufin-cli
index ef9c791..7a202ca 100755
--- a/sandbox/src/main/python/libeufin-cli
+++ b/sandbox/src/main/python/libeufin-cli
@@ -570,6 +570,67 @@ 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="Prepare a payment")
+@click.pass_context
+@click.option(
+    "--account-id",
+    help="Numerical ID of the customer at the Nexus",
+    required=True
+)
+@click.option(
+    "--bank-account-id",
+    help="Token that identifies one bank account belonging to --account-id",
+    required=True
+)
+@click.option(
+    "--creditor-iban",
+    help="IBAN of the creditor",
+    required=True
+)
+@click.option(
+    "--creditor-bic",
+    help="BIC of the creditor",
+    required=True
+)
+@click.option(
+    "--creditor-name",
+    help="First and last name of the creditor",
+    required=True
+)
+@click.option(
+    "--subject",
+    help="subject line of the payment",
+    required=True
+)
+@click.option(
+    "--sum",
+    help="amount to pay, in the form XY[.UW], no currency needed (for now)",
+    required=True
+)
+@click.argument(
+  "nexus-base-url"
+)
+def prepare_payment(
+    ctx, account_id, bank_account_id, creditor_iban,
+    creditor_bic, creditor_name, subject, amount, nexus_base_url):
+    nexus_url = urljoin(
+        nexus_base_url, 
"/ebics/subscribers/{}/accounts/{}/prepare-payment".format(
+            account_id, bank_account_id))
+    body = dict(
+            ebicsURL=ebics_url,
+            userID=user_id,
+            partnerID=partner_id,
+            hostID=host_id
+    )
+    try:
+        resp = post(nexus_url, json=body)
+    except Exception:
+        print("Could not reach the Nexus")
+        return
+
+    print(resp.content.decode("utf-8"))
+
 @ebics.command(help="Send HTD message")
 @click.pass_context
 @click.option(

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]