diff --git a/app/views/foodcourt/qrpay/init.html.erb b/app/views/foodcourt/qrpay/init.html.erb index 9b55723e..67ec371e 100644 --- a/app/views/foodcourt/qrpay/init.html.erb +++ b/app/views/foodcourt/qrpay/init.html.erb @@ -205,16 +205,22 @@
-
+
+ MMQR Payment

Waiting for Customer Payment

Please ask customer to scan the QR code

-
+ <% if @qr_svg %> +
+ <%= raw @qr_svg %> +
+ <% end %> +
-
+
" id="server_mode"> @@ -252,8 +258,7 @@ document.addEventListener('DOMContentLoaded', function() { const paymentWaiting = document.querySelector('.payment-waiting'); let amountToReceive = <%= number_with_precision(@sale_data.grand_total, precision: precision.to_i) %>; - let receipt_no = document.querySelector('#receipt_no').textContent; - console.log(receipt_no); + const receipt_no = document.querySelector('#receipt_no').textContent; const ws = new WebSocket("wss://juicecorner-0mo.sx-fc.app/cable"); @@ -264,7 +269,8 @@ ws.send(JSON.stringify({ command: "subscribe", identifier: JSON.stringify({ - channel: "TestChannel" + channel: "TestChannel", + // receipt_no: receipt_no }) })); } @@ -279,6 +285,7 @@ if(msg?.message?.status === "PAY_SUCCESS") { paymentWaiting.innerHTML = ` + MMQR Payment
check_circle

Payment Successful!

@@ -341,10 +348,12 @@ }, body: JSON.stringify(data) }).then(function(res) { + customer_display_view(null,"reload"); return res.json(); }).then(function(data) { if(data.status) { - window.location.href = "/" + + window.location.href = "/"; } }); }); diff --git a/app/views/foodcourt/second_display/_second_display.html.erb b/app/views/foodcourt/second_display/_second_display.html.erb index e78c2703..2184910e 100644 --- a/app/views/foodcourt/second_display/_second_display.html.erb +++ b/app/views/foodcourt/second_display/_second_display.html.erb @@ -50,50 +50,61 @@
-