支付完成回调页面

This commit is contained in:
2022-09-19 10:42:07 +08:00
parent d9fef54da4
commit 239997dff1
2 changed files with 5 additions and 3 deletions

View File

@@ -101,6 +101,7 @@ class Wechat
{ {
$clientToken = Request::get('token'); $clientToken = Request::get('token');
$orderId = Request::get('order_id'); $orderId = Request::get('order_id');
$callback = Request::get('callback');
if ($clientToken) { if ($clientToken) {
$tk = json_decode(authcode($clientToken), true); $tk = json_decode(authcode($clientToken), true);
$userId = $tk['userid']; $userId = $tk['userid'];
@@ -150,7 +151,7 @@ class Wechat
} }
$prepayId = $unify['prepay_id']; $prepayId = $unify['prepay_id'];
$jssdk = $payment->jssdk->bridgeConfig($prepayId, false); $jssdk = $payment->jssdk->bridgeConfig($prepayId, false);
return View::fetch('', ['jssdk' => $jssdk]); return View::fetch('', ['jssdk' => $jssdk, 'callback' => $callback]);
} }
/** /**

View File

@@ -49,7 +49,8 @@
, btn: ['3秒后自动返回'] , btn: ['3秒后自动返回']
, time: 3 , time: 3
, end: function () { , end: function () {
window.history.back() window.local.href = '{$callback}';
// window.history.back()
} }
}); });
}, 1000); }, 1000);
@@ -60,7 +61,7 @@
, btn: ['3秒后自动返回'] , btn: ['3秒后自动返回']
, time: 3 , time: 3
, end: function () { , end: function () {
window.history.back() window.local.href = '{$callback}';
} }
}); });
} }