no message
This commit is contained in:
parent
848c33808f
commit
447fb212ec
@ -120,8 +120,17 @@ final class Epay extends Base
|
|||||||
|
|
||||||
$resData = json_decode($res->getBody()->__toString(), true);
|
$resData = json_decode($res->getBody()->__toString(), true);
|
||||||
|
|
||||||
if ($resData['code'] !== 1 || ! isset($resData['payurl'])) {
|
if ($resData['code'] !== 1) {
|
||||||
throw new Exception("没有payurl");
|
throw new Exception("code不等于1");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果没有payurl,把qrcode当payurl
|
||||||
|
if (!isset($resData['payurl'])) {
|
||||||
|
if (isset($resData['qrcode'])) {
|
||||||
|
$resData['payurl'] = $resData['qrcode'];
|
||||||
|
} else {
|
||||||
|
throw new Exception("没有payurl,也没有qrcode");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response->withHeader('HX-Redirect', $resData['payurl'])->withJson([
|
return $response->withHeader('HX-Redirect', $resData['payurl'])->withJson([
|
||||||
@ -129,12 +138,6 @@ final class Epay extends Base
|
|||||||
'msg' => '订单发起成功,正在跳转到支付页面...',
|
'msg' => '订单发起成功,正在跳转到支付页面...',
|
||||||
]);
|
]);
|
||||||
} catch (Exception|GuzzleException $e) {
|
} catch (Exception|GuzzleException $e) {
|
||||||
// if ($user["is_admin"] == 1) {
|
|
||||||
// return $response->withJson([
|
|
||||||
// 'ret' => 0,
|
|
||||||
// 'msg' => json_encode($e->getMessage()),
|
|
||||||
// ]);
|
|
||||||
// } else {
|
|
||||||
|
|
||||||
$aMsg = [
|
$aMsg = [
|
||||||
'标题' => '有用户支付失败',
|
'标题' => '有用户支付失败',
|
||||||
@ -152,8 +155,6 @@ final class Epay extends Base
|
|||||||
'msg' => '请求支付失败,请联系管理员',
|
'msg' => '请求支付失败,请联系管理员',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user