|
|
|
@ -73,7 +73,7 @@ $(document).ready(function () {
|
|
|
|
|
}, function (res) {
|
|
|
|
|
dataCache.paying = false;
|
|
|
|
|
if (res.err_msg == 'get_brand_wcpay_request:ok') {
|
|
|
|
|
startCheckOrder(window.order_id)
|
|
|
|
|
startCheckOrder(window.order_id,window.redirect + (window.redirect.indexOf('?') < 0 ? '?' : '&') + 'success=true')
|
|
|
|
|
} else {
|
|
|
|
|
if (res.err_msg != 'get_brand_wcpay_request:cancel' && res.err_msg != 'get_brand_wcpay_request:fail') {
|
|
|
|
|
alert('WeChat Error:' + res.err_msg);
|
|
|
|
@ -87,7 +87,8 @@ $(document).ready(function () {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function startCheckOrder(orderId) {
|
|
|
|
|
|
|
|
|
|
function startCheckOrder(orderId, url) {
|
|
|
|
|
function checkOrderStd() {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '/api/v1.0/payment/orders/' + orderId + '/status',
|
|
|
|
@ -95,7 +96,7 @@ $(document).ready(function () {
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
success: function (res) {
|
|
|
|
|
if (res.paid) {
|
|
|
|
|
location.href = window.redirect + (window.redirect.indexOf('?') < 0 ? '?' : '&') + 'success=true';
|
|
|
|
|
location.href = url;
|
|
|
|
|
} else {
|
|
|
|
|
setTimeout(checkOrderStd, 500);
|
|
|
|
|
}
|
|
|
|
|