summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorms <ms@taler.net>2021-12-01 14:12:03 +0100
committerms <ms@taler.net>2021-12-01 14:12:03 +0100
commit41f21e32915139b19601dcdcefec95c93c2a0a81 (patch)
tree41eb116c5e4c5af517a1c4e54f011b6524efcd2e
parent19eaabc6100bb12b6758b5040476f0448ebbaac3 (diff)
downloaddeployment-41f21e32915139b19601dcdcefec95c93c2a0a81.tar.gz
deployment-41f21e32915139b19601dcdcefec95c93c2a0a81.tar.bz2
deployment-41f21e32915139b19601dcdcefec95c93c2a0a81.zip
taler-local
allow bank host and protocol to be passed as CLI arguments to the withdraw subcommand.
-rwxr-xr-xbin/WIP/taler-local17
1 files changed, 14 insertions, 3 deletions
diff --git a/bin/WIP/taler-local b/bin/WIP/taler-local
index 7c495ff..e8b6df4 100755
--- 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)