diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2020-03-31 18:41:30 +0200 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2020-03-31 18:41:30 +0200 |
commit | 44ce3b084f676f2fe43d9e7a0906538177c2cbf3 (patch) | |
tree | 8326eab3f6a585b5d47d6945939b9332723d8180 | |
parent | 00f798e504398aaed4b17e8427814525faeeba11 (diff) | |
download | libeufin-44ce3b084f676f2fe43d9e7a0906538177c2cbf3.tar.gz libeufin-44ce3b084f676f2fe43d9e7a0906538177c2cbf3.tar.bz2 libeufin-44ce3b084f676f2fe43d9e7a0906538177c2cbf3.zip |
Give CLI Taler-refund command.
-rwxr-xr-x | cli/python/libeufin-cli | 15 | ||||
-rw-r--r-- | nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 2 |
2 files changed, 13 insertions, 4 deletions
diff --git a/cli/python/libeufin-cli b/cli/python/libeufin-cli index 72a2d449..a7537915 100755 --- a/cli/python/libeufin-cli +++ b/cli/python/libeufin-cli @@ -443,10 +443,19 @@ def crz(obj, account_id, date_range, nexus_base_url): "nexus-base-url" ) def refund(ctx, account_id, bank_account_id, nexus_base_url): + nexus_url = urljoin( + nexus_base_url, "/ebics/taler/{}/accounts/{}/refund-invalid-payments".format( + account_id, bank_account_id + ) + ) + try: + resp = post(nexus_url, json=body) + except Exception: + print("Could not reach the Nexus") + return + print(resp.content.decode("utf-8")) - - -@taler.command(help="Separate payments with Taler-subject from the rest") +@taler.command(help="Flag Taler-invalid incoming payments.") @click.pass_obj @click.option( "--account-id", diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt index 726fbfe3..7ee52e7b 100644 --- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt +++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt @@ -630,7 +630,7 @@ fun main() { return@get } - post("/ebics/taler/{id}/{acctid}/refund-invalid-payments") { + post("/ebics/taler/{id}/accounts/{acctid}/refund-invalid-payments") { transaction { val subscriber = expectIdTransaction(call.parameters["id"]) val acctid = expectAcctidTransaction(call.parameters["acctid"]) |