This commit is contained in:
Hankin 2025-08-13 14:00:53 +08:00
parent 1e6efdcd80
commit 7b84fb3b89

View File

@ -111,7 +111,7 @@ class WechatPayService
public function transferBatches(string $trade_no, string $trade_no2, string $openid, int $amount, string $remark): array
{
try {
// try {
$appid = config("wechat.official_account.default.app_id");
$data = [
"appid" => $appid,
@ -134,17 +134,17 @@ class WechatPayService
]);
$res = json_decode($resp->getBody(), true);
dd($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()];
}
// } 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()];
// }
return ["code" => 1, "err_msg" => $e->getMessage()];
}
// return ["code" => 1, "err_msg" => $e->getMessage()];
// }
}