commit 41f21e32915139b19601dcdcefec95c93c2a0a81
parent 19eaabc6100bb12b6758b5040476f0448ebbaac3
Author: ms <ms@taler.net>
Date: Wed, 1 Dec 2021 14:12:03 +0100
taler-local
allow bank host and protocol to be passed as CLI
arguments to the withdraw subcommand.
Diffstat:
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/bin/WIP/taler-local b/bin/WIP/taler-local
@@ -1373,7 +1373,7 @@ def prepare(x_forwarded_host, x_forwarded_proto):
password=EXCHANGE_BANK_ACCOUNT_PASSWORD
)
print(" OK")
- print_nn("Getting exchange payto-URI from the bank.")
+ print_nn("Getting exchange payto-URI from the bank...")
exchange_bank_account_info = get_sandbox_account_info(
SANDBOX_URL,
EXCHANGE_BANK_ACCOUNT_SANDBOX,
@@ -1694,9 +1694,20 @@ def stop():
subprocess.run(["systemctl", "--user", "stop", "taler-local-*.service"], check=True)
@cli.command()
-def withdraw():
+@click.option(
+ "--bank-host", metavar="HOST",
+ help="Host serving the bank.",
+ default="localhost:8080"
+)
+@click.option(
+ "--bank-proto", metavar="PROTO",
+ help="Protocol accepred by the bank",
+ default="http"
+)
+def withdraw(bank_host, bank_proto):
print_nn("Create withdrawal operation...")
- resp = requests.post(REV_PROXY_URL +
+ bank_base_url = bank_proto + "://" + bank_host
+ resp = requests.post(bank_base_url +
f"/sandbox/demobanks/default/access-api/accounts/{CUSTOMER_BANK_ACCOUNT}/withdrawals",
json = dict(amount=CURRENCY + ":5"),
auth = requests.auth.HTTPBasicAuth(CUSTOMER_BANK_ACCOUNT, CUSTOMER_BANK_PASSWORD)