summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorms <ms@taler.net>2021-11-27 07:40:50 +0100
committerms <ms@taler.net>2021-11-27 07:40:50 +0100
commit503cb67bdc52a6337830717bc8ffecaf066b94c5 (patch)
tree827ce3ce96705f3c0b161f8d2da2218cea95846a
parent3b62a610aeb14554ce8ba3a08b7541f3a337133f (diff)
downloaddeployment-503cb67bdc52a6337830717bc8ffecaf066b94c5.tar.gz
deployment-503cb67bdc52a6337830717bc8ffecaf066b94c5.tar.bz2
deployment-503cb67bdc52a6337830717bc8ffecaf066b94c5.zip
taler-local: get instances payto RESTfully
-rwxr-xr-xbin/WIP/taler-local62
1 files changed, 40 insertions, 22 deletions
diff --git a/bin/WIP/taler-local b/bin/WIP/taler-local
index 9945c8e..a777ac7 100755
--- a/bin/WIP/taler-local
+++ b/bin/WIP/taler-local
@@ -742,7 +742,6 @@ def prepare():
# This value is BOTH a username
# and a bank account label.
bank_account_name,
- bank_account_iban,
password
):
demobank_url = urljoin_nodrop(sandbox_url, "/demobanks/default")
@@ -799,7 +798,9 @@ def prepare():
# Instances
INSTANCES = {
"GNUnet": IBAN_MERCHANT_DEMOSHOP,
- "FSF": IBAN_MERCHANT_DEMOSHOP,
+ "Taler": IBAN_MERCHANT_DEMOSHOP,
+ "Tor": IBAN_MERCHANT_DEMOSHOP,
+ "survey": IBAN_MERCHANT_DEMOSHOP,
"blog": IBAN_MERCHANT_DEMOSHOP
}
@@ -966,7 +967,6 @@ def prepare():
currency,
rev_proxy_url,
wire_method,
- exchange_iban,
merchant_wire_address,
exchange_wire_gateway_username,
exchange_wire_gateway_password,
@@ -1087,12 +1087,6 @@ def prepare():
obj.cfg_put("exchangedb-postgres", "config", "postgres:///taler")
obj.cfg_put("auditordb-postgres", "db_conn_str", "postgres:///taler")
obj.cfg_put("auditordb-postgres", "config", "postgres:///taler")
-
- # Better to get this value from GET /accounts at Sandbox.
- obj.cfg_put(
- "exchange-account-1",
- "payto_uri", f"payto://iban/SANDBOXX/{exchange_iban}?receiver-name=Unknown"
- )
obj.cfg_put("exchange-account-1", "enable_debit", "yes")
obj.cfg_put("exchange-account-1", "enable_credit", "yes")
obj.cfg_put("merchant-account-merchant", "payto_uri",
@@ -1176,7 +1170,6 @@ def prepare():
currency=CURRENCY,
rev_proxy_url=REV_PROXY_URL,
wire_method=WIRE_METHOD,
- exchange_iban=IBAN_EXCHANGE,
merchant_wire_address=IBAN_MERCHANT_DEFAULT,
exchange_wire_gateway_username=EXCHANGE_NEXUS_USERNAME,
exchange_wire_gateway_password=EXCHANGE_NEXUS_PASSWORD,
@@ -1361,12 +1354,11 @@ Logs: {rev_proxy.get_log_filename()}"
ebics_user_id=EXCHANGE_EBICS_USER_ID,
person_name="Exchange Owner",
bank_account_name=EXCHANGE_BANK_ACCOUNT_SANDBOX,
- bank_account_iban=IBAN_EXCHANGE,
password=EXCHANGE_BANK_ACCOUNT_PASSWORD
)
print(" OK")
print_nn("Getting exchange payto-URI from the bank.")
- exchange_bank_account_info=get_sandbox_account_info(
+ exchange_bank_account_info = get_sandbox_account_info(
SANDBOX_URL,
EXCHANGE_BANK_ACCOUNT_SANDBOX,
EXCHANGE_BANK_ACCOUNT_PASSWORD
@@ -1404,7 +1396,6 @@ Logs: {rev_proxy.get_log_filename()}"
ebics_user_id=f"unused{instance_id}EbicsUserId",
person_name=f"Shop Owner of {instance_id}",
bank_account_name=f"sandbox-account-{instance_id.lower()}",
- bank_account_iban=iban,
password=ALL_INSTANCES_BANK_PASSWORD
)
print(" OK")
@@ -1416,7 +1407,6 @@ Logs: {rev_proxy.get_log_filename()}"
ebics_user_id="unusedCustomerEbicsUserId",
person_name="Customer Person",
bank_account_name=CUSTOMER_BANK_ACCOUNT,
- bank_account_iban=IBAN_CUSTOMER,
password=CUSTOMER_BANK_PASSWORD
)
print(" OK")
@@ -1501,9 +1491,6 @@ Logs: {rev_proxy.get_log_filename()}"
print_nn("Terminating Nexus...")
nexus_handle.stop()
print(" OK")
- print_nn("Terminating Sandbox...")
- sandbox_handle.stop()
- print(" OK")
print_nn("Set suggested exchange at Sandbox...")
Command([
"libeufin-sandbox",
@@ -1579,12 +1566,15 @@ Logs: {rev_proxy.get_log_filename()}"
urljoin_nodrop(backend_url, f"management/instances/{instance_id}"),
headers = auth_header
)
+ bankaccount_info = get_sandbox_account_info(
+ SANDBOX_URL,
+ f"sandbox-account-{instance_id.lower()}",
+ ALL_INSTANCES_BANK_PASSWORD
+ )
req = dict(
id=instance_id,
name=f"Name of '{instance_id}'",
- payto_uris=[
- f"payto://{wire_method}/{bank_hostname}/{merchant_wire_address}?receiver-name=Unknown"
- ],
+ payto_uris=[bankaccount_info["paytoUri"]],
address=dict(),
jurisdiction=dict(),
default_max_wire_fee=f"{currency}:1",
@@ -1626,7 +1616,17 @@ Logs: {rev_proxy.get_log_filename()}"
rev_proxy
)
print(" OK")
-
+ print_nn("Give default instance a bank account...")
+ prepare_sandbox_account(
+ sandbox_url=SANDBOX_URL,
+ ebics_host_id=EBICS_HOST_ID,
+ ebics_partner_id="unusedMerchantEbicsPartnerId",
+ ebics_user_id=f"unusedDefaultInstanceEbicsUserId",
+ person_name=f"Shop Owner of default instance",
+ bank_account_name="sandbox-account-default",
+ password=ALL_INSTANCES_BANK_PASSWORD
+ )
+ print(" OK")
ensure_instance(
currency=CURRENCY,
instance_id="default",
@@ -1662,7 +1662,9 @@ Logs: {rev_proxy.get_log_filename()}"
auth_token=FRONTENDS_API_TOKEN
)
print(" OK")
-
+ print_nn("Terminating Sandbox...")
+ sandbox_handle.stop()
+ print(" OK")
print_nn("Stopping the merchant backend...")
merchant_handle.stop()
print(" OK")
@@ -1758,6 +1760,18 @@ Logs: {rev_proxy.get_log_filename()}"
cmd = f"{TALER_PREFIX}/bin/taler-merchant-demos blog -c {CFG_OUTDIR / 'taler.conf'}",
env = TALER_UNIT_FILES_DIR / "taler-frontends-local.env"
))
+ with open(TALER_UNIT_FILES_DIR / "taler-survey-local.service", "w") as survey_unit:
+ survey_unit.write(unit_file_content(
+ description = "Survey Website awarding tips via Taler.",
+ cmd = f"{TALER_PREFIX}/bin/taler-merchant-demos survey -c {CFG_OUTDIR / 'taler.conf'}",
+ env = TALER_UNIT_FILES_DIR / "taler-frontends-local.env"
+ ))
+ with open(TALER_UNIT_FILES_DIR / "taler-landing-local.service", "w") as landing_unit:
+ landing_unit.write(unit_file_content(
+ description = "Landing Website of Taler demo.",
+ cmd = f"{TALER_PREFIX}/bin/taler-merchant-demos landing -c {CFG_OUTDIR / 'taler.conf'}",
+ env = TALER_UNIT_FILES_DIR / "taler-frontends-local.env"
+ ))
with open(TALER_UNIT_FILES_DIR / "taler-frontends-local.env", "w") as frontends_env:
frontends_env.write((
f"PATH={os.environ.get('PATH')}\n"
@@ -1787,6 +1801,8 @@ def launch():
subprocess.run(["systemctl", "--user", "start", "libeufin-sandbox-local.service"], check=True)
subprocess.run(["systemctl", "--user", "start", "taler-donations-local.service"], check=True)
subprocess.run(["systemctl", "--user", "start", "taler-blog-local.service"], check=True)
+ subprocess.run(["systemctl", "--user", "start", "taler-survey-local.service"], check=True)
+ subprocess.run(["systemctl", "--user", "start", "taler-landing-local.service"], check=True)
rev_proxy = TalerReverseProxy(
LOG_DIR,
@@ -1802,6 +1818,8 @@ def launch():
)
# Stop with CTRL+C
print_nn("Stopping the services...")
+ subprocess.run(["systemctl", "--user", "stop", "taler-landing-local.service"], check=True)
+ subprocess.run(["systemctl", "--user", "stop", "taler-survey-local.service"], check=True)
subprocess.run(["systemctl", "--user", "stop", "taler-blog-local.service"], check=True)
subprocess.run(["systemctl", "--user", "stop", "taler-donations-local.service"], check=True)
subprocess.run(["systemctl", "--user", "stop", "libeufin-sandbox-local.service"], check=True)