update logic

This commit is contained in:
cnohall 2024-09-06 10:05:33 +09:00
parent 67379d7c4f
commit 926b2870ed

View File

@ -65,7 +65,10 @@
ws.onmessage = function(event) { ws.onmessage = function(event) {
const data = JSON.parse(event.data); const data = JSON.parse(event.data);
console.log('Payment status:', data.status); console.log('Payment status:', data.status);
document.getElementById('server-response').submit(); const isPaymentConfirmed = data.status == 2;
if (isPaymentConfirmed) {
document.getElementById('server-response').submit();
}
}; };
ws.onerror = function(error) { ws.onerror = function(error) {