summaryrefslogtreecommitdiff
path: root/talerbank/app/templates/withdraw_show.html
blob: 675099e122e45f88d70fb9f4a30eb8cf68898372 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{% extends "base.html" %}

{% block head %}
<script>
  // prettier-ignore
  let checkUrl = JSON.parse('{{ withdraw_check_url | tojson }}');
  let delayMs = 500;
  function check() {
    let req = new XMLHttpRequest();
    req.onreadystatechange = function () {
      if (req.readyState === XMLHttpRequest.DONE) {
        if (req.status === 200) {
          try {
            let resp = JSON.parse(req.responseText);
            if (resp.selection_done) {
              document.location.reload(true);
            }
          } catch (e) {
            console.error("could not parse response:", e);
          }
        }
        setTimeout(check, delayMs);
      }
    };
    req.onerror = function () {
      setTimeout(check, delayMs);
    }
    req.open("GET", checkUrl);
    req.send();
  }

  setTimeout(check, delayMs);

</script>
{% endblock head %}

{% block main %}
<h1 class="nav">{{ _("Withdraw to a Taler Wallet") }}</h1>

<p>
  {{ _("You can use this QR code to withdraw to your mobile wallet:") }}
</p>
{{ qrcode_svg | safe }}
<p>
  {% autoescape off %}
  {{ _("Click <a href=\"{taler_withdraw_uri}\">this link</a> to open your system's Taler wallet if it exists.").format(taler_withdraw_uri=taler_withdraw_uri) }}
  {% endautoescape %}
</p>

{% endblock main %}