This commit is contained in:
Hankin 2026-04-23 16:09:45 +08:00
parent b765f7057e
commit 2d95e7824b

View File

@ -74,7 +74,7 @@ class WechatPayService
],
];
}
try {
// try {
$appid = config("wechat.official_account.default.app_id");
$data = [
"appid" => $appid,
@ -92,17 +92,17 @@ class WechatPayService
]);
$res = json_decode($resp->getBody(), true);
return ["code" => 0, "err_msg" => "", "data" => $res];
} catch (\Exception $e) {
// 进行异常捕获并进行错误判断处理
Log::info($e->getMessage());
if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) {
$r = $e->getResponse();
$res = json_decode($r->getBody());
return ["code" => 1, "err_msg" => $r->getBody(), "data" => null];
}
// } catch (\Exception $e) {
// // 进行异常捕获并进行错误判断处理
// Log::info($e->getMessage());
// if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) {
// $r = $e->getResponse();
// $res = json_decode($r->getBody());
// return ["code" => 1, "err_msg" => $r->getBody(), "data" => null];
// }
return ["code" => 1, "err_msg" => $e->getMessage(), "data" => null];
}
// return ["code" => 1, "err_msg" => $e->getMessage(), "data" => null];
// }
}
/**