no message
This commit is contained in:
parent
845cdc809a
commit
adcfcf11c0
@ -115,13 +115,13 @@ final class Epay extends Base
|
|||||||
$res = $client->request('POST', $this->epay['apiurl'] . 'mapi.php', ['form_params' => $data]);
|
$res = $client->request('POST', $this->epay['apiurl'] . 'mapi.php', ['form_params' => $data]);
|
||||||
|
|
||||||
if ($res->getStatusCode() !== 200) {
|
if ($res->getStatusCode() !== 200) {
|
||||||
throw new Exception();
|
throw new Exception("return code 不等于200");
|
||||||
}
|
}
|
||||||
|
|
||||||
$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 || ! isset($resData['payurl'])) {
|
||||||
throw new Exception();
|
throw new Exception("没有payurl");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response->withHeader('HX-Redirect', $resData['payurl'])->withJson([
|
return $response->withHeader('HX-Redirect', $resData['payurl'])->withJson([
|
||||||
@ -136,7 +136,15 @@ final class Epay extends Base
|
|||||||
// ]);
|
// ]);
|
||||||
// } else {
|
// } else {
|
||||||
|
|
||||||
(new Telegram())->send(0, '有用户微信支付失败');
|
$aMsg = [
|
||||||
|
'标题' => '有用户微信支付失败',
|
||||||
|
'报错' => $e->getMessage(),
|
||||||
|
'返回值' => $res
|
||||||
|
];
|
||||||
|
|
||||||
|
$sMsg = json_encode($aMsg, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||||
|
|
||||||
|
(new Telegram())->send(0, $sMsg);
|
||||||
|
|
||||||
return $response->withJson([
|
return $response->withJson([
|
||||||
'ret' => 0,
|
'ret' => 0,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user