commit f217a4fa41bf0d686dff664c429dfdf3e93c8a76
parent 6c35610da6fd5d294b77fb119012b1d5d357bf91
Author: NicholasFarrow <nicholas.w.farrow@gmail.com>
Date: Tue, 22 Dec 2020 01:26:21 +1100
small bug fixes
Diffstat:
2 files changed, 8 insertions(+), 42 deletions(-)
diff --git a/pay/bitcoind.py b/pay/bitcoind.py
@@ -15,7 +15,7 @@ class btcd:
print("Successfully contacted bitcoind.")
print("-"*10)
- print(info)
+ #print(info)
print("-"*10)
except Exception as e:
diff --git a/templates/payment.html b/templates/payment.html
@@ -1,7 +1,13 @@
<!DOCTYPE html>
<html>
<head>
- <script type=text/javascript src="{{ url_for('static', filename='jquery.min.js') }}"></script>
+ <script src="https://cdn.jsdelivr.net/npm/socket.io-client@3/dist/socket.io.js" crossorigin="anonymous"></script>
+ <script type="text/javascript" charset="utf-8">
+ var socket = io();
+ socket.on('connect', function() {
+ socket.emit('my event', {data: 'I\'m connected!'});
+ });
+ </script>
<script type=text/javascript>
$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
</script>
@@ -11,48 +17,8 @@
<h1>Payment</h1>
<script type=text/javascript>
- $(function() {
- $('a#calculate').bind('click', function() {
-
-
- // Check for payment
- // If paid, show confirmation message
- // If unpaid, wait x seconds before checking again.
- // Continue counting down until an expiry, this expiry will be refreshed
- // in the javascript to remain in sync.
- //
- setInterval(
- $.ajax({
- url: '/pay',
- type: 'get',
- data: {'amount' : $('input[name="amount"]').val(),
- 'unique_id' : uuidv4()},
- success: function(response) {
- console.log(response);
- $("#result").html(response["paid"]);
- },
- error: function(error) {
- console.log(error);
- }}),
-
- sleep(5));
- };
- })})
- //
- //
- // $.ajax({
- // url: "$SCRIPT_ROOT + '/pay'",
- // type:
- // {
- // amount: $('input[name="amount"]').val()
- // }, function(data) {
- // $("#result").text(data.result);
- // });
- // return false;
- // });
- // });
</script>
<h1>Pay {{ amount }}</h1>