summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2022-08-25 15:34:40 +0200
committerMS <ms@taler.net>2022-08-25 15:34:40 +0200
commit022eef39974a6e32e63ba41db523d6ec1781d0e3 (patch)
tree2364919b4e464d6b35a8f02c521fe15538e32526
parent06a4844de64597d963ef2781b2a99b97f2fbedb0 (diff)
downloaddeployment-022eef39974a6e32e63ba41db523d6ec1781d0e3.tar.gz
deployment-022eef39974a6e32e63ba41db523d6ec1781d0e3.tar.bz2
deployment-022eef39974a6e32e63ba41db523d6ec1781d0e3.zip
taler-local: remove obsolete subcommand
-rwxr-xr-xbin/taler-local66
1 files changed, 0 insertions, 66 deletions
diff --git a/bin/taler-local b/bin/taler-local
index 16ecb0c..314b2ab 100755
--- a/bin/taler-local
+++ b/bin/taler-local
@@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with GNU Taler. If not, see <https://www.gnu.org/licenses/>.
-import qrcode
import socket
import shutil
import atexit
@@ -1815,70 +1814,5 @@ def launch():
def stop():
subprocess.run(["systemctl", "--user", "stop", "taler-local-*.service"], check=True)
-@cli.command()
-@click.option(
- "--bank-host", metavar="HOST",
- help="Host serving the bank, defaults to 'localhost:8080'.",
- default="localhost:8080"
-)
-@click.option(
- "--bank-proto", metavar="PROTO",
- help="Protocol accepred by the bank, defaults to 'http'",
- default="http"
-)
-@click.option(
- "--with-qr-code", is_flag=True,
- help="""When specified, it prints the QR code on screen,
-and waits the user's input before confirming the operation
-at the bank.""",
- default=False
-)
-def withdraw(bank_host, bank_proto, with_qr_code):
- print_nn("Create withdrawal operation...")
- 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)
- )
- try:
- resp.raise_for_status()
- except Exception as error:
- print("Could not create withdrawal")
- print(error)
- exit(1)
- withdrawal_id = resp.json()["withdrawal_id"]
- withdraw_uri = resp.json()["taler_withdraw_uri"]
- print(" OK")
- print("Let wallet specify the reserve public key at the bank...")
- # Let wallet give the reserve public key to the bank.
- if with_qr_code:
- withdraw_QR_code = qrcode.QRCode()
- withdraw_QR_code.add_data(withdraw_uri)
- withdraw_QR_code.print_ascii()
- print(withdraw_uri)
- input("After scanning the code, press ENTER to wire funds to the Exchange: ")
- else:
- subprocess.run(["taler-wallet-cli", "handle-uri", withdraw_uri], check=True)
- # Let the user confirm the withdrawal operation and
- # get the bank wire the funds.
- print_nn("Confirm withdrawal operation at the bank...")
- resp = requests.post(bank_base_url +
- f"/sandbox/demobanks/default/access-api/accounts/{CUSTOMER_BANK_ACCOUNT}/withdrawals/{withdrawal_id}/confirm",
- auth = requests.auth.HTTPBasicAuth(CUSTOMER_BANK_ACCOUNT, CUSTOMER_BANK_PASSWORD)
- )
- try:
- resp.raise_for_status()
- except Exception as error:
- print("Could not create withdrawal")
- print(error)
- exit(1)
- print(" OK")
- if not with_qr_code:
- print("Let wallet complete all pending operations")
- # FIXME: Why the following operation twice?
- subprocess.run(["taler-wallet-cli", "handle-uri", withdraw_uri], check=True)
- subprocess.run(["taler-wallet-cli", "run-until-done"], check=True)
-
if __name__ == "__main__":
cli()