|
|
|
@ -17,6 +17,24 @@ $(function () {
|
|
|
|
|
|
|
|
|
|
if (window.disable_ws) {
|
|
|
|
|
setTimeout(checkStatus, 3000);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
var sock = new SockJS('/register');
|
|
|
|
|
var client = Stomp.over(sock);
|
|
|
|
|
client.connect({}, function () {
|
|
|
|
|
client.subscribe('/app/payment/orders/' + window.order_id, function (msg) {
|
|
|
|
|
var json = JSON.parse(msg.body);
|
|
|
|
|
var concat = '?';
|
|
|
|
|
if (window.redirect.indexOf('?') > 0) {
|
|
|
|
|
concat = '&';
|
|
|
|
|
}
|
|
|
|
|
location.href = window.redirect + concat + 'time=' + json.time + '&nonce_str=' + json.nonce_str + '&sign=' + json.sign;
|
|
|
|
|
})
|
|
|
|
|
},function () {
|
|
|
|
|
setTimeout(checkStatus, 3000);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function checkStatus() {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: 'status',
|
|
|
|
@ -36,19 +54,4 @@ $(function () {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
var sock = new SockJS('/register');
|
|
|
|
|
var client = Stomp.over(sock);
|
|
|
|
|
client.connect({}, function () {
|
|
|
|
|
client.subscribe('/app/payment/orders/' + window.order_id, function (msg) {
|
|
|
|
|
var json = JSON.parse(msg.body);
|
|
|
|
|
var concat = '?';
|
|
|
|
|
if (window.redirect.indexOf('?') > 0) {
|
|
|
|
|
concat = '&';
|
|
|
|
|
}
|
|
|
|
|
location.href = window.redirect + concat + 'time=' + json.time + '&nonce_str=' + json.nonce_str + '&sign=' + json.sign;
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|