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