taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

commit 1b41f4bd64c7b0aadce56028761f3c902c6b9710
parent 90f498256686d3afa1a347b14afdc312cdf728a8
Author: MS <ms@taler.net>
Date:   Mon, 27 Jul 2020 10:41:43 +0200

reserve authorization

Diffstat:
Mbin/taler-config-tips | 41++++++++++++-----------------------------
1 file changed, 12 insertions(+), 29 deletions(-)

diff --git a/bin/taler-config-tips b/bin/taler-config-tips @@ -1,33 +1,16 @@ -#!/usr/bin/env python3 +#!/bin/bash -from requests import post -from os import environ -from sys import exit -from urllib.parse import urljoin +set -eo -def expectResponse(response, expected_status_codes): - if response.status_code not in expected_status_codes: - print("Configuration failed on URL: {}".format(response.url)) - print(response.text) - exit(1) - # Allows for finer grained checks. - return response +MERCHANT_URL=$(taler-config -s frontends -o backend) +CURRENCY=$(taler-config -s taler -o currency) +EXCHANGE_URL=$(taler-config -s exchange -o base_url) +WIRE_METHOD="x-taler-bank" -TALER_ENV_NAME = environ.get("TALER_ENV_NAME") -if not TALER_ENV_NAME: - print("TALER_ENV_NAME not defined. Please source the ~/activate file.") - exit(1) -MERCHANT_BACKEND = f"https://backend.{TALER_ENV_NAME}.taler.net/" -TALER_CONFIG_CURRENCY = environ.get("TALER_CONFIG_CURRENCY", "EUR") +# Call merchant tool for reserve authorization. +taler-merchant-setup-reserve --amount="${CURRENCY}:50" \ + --exchange-url=${EXCHANGE_URL} \ + --merchant-url=${MERCHANT_URL} \ + --wire-method=${WIRE_METHOD} -expectResponse( - post( - urljoin(MERCHANT_BACKEND, "instances/survey/private/reserves"), - json=dict( - initial_balance=f"{TALER_CONFIG_CURRENCY}:50", - exchange_url=f"https://exchange.{TALER_ENV_NAME}.taler.net/", - wire_method="x-taler-bank" - ) - ), - [200] -) +# Call exchange tool for money transfer.