transfer
This commit is contained in:
parent
b765f7057e
commit
2d95e7824b
@ -74,35 +74,35 @@ class WechatPayService
|
||||
],
|
||||
];
|
||||
}
|
||||
try {
|
||||
$appid = config("wechat.official_account.default.app_id");
|
||||
$data = [
|
||||
"appid" => $appid,
|
||||
"out_bill_no" => $trade_no,
|
||||
"transfer_scene_id" => (string) $scene_id,
|
||||
"openid" => $openid,
|
||||
"transfer_amount" => $amount,
|
||||
"transfer_remark" => $remark,
|
||||
"transfer_scene_report_infos" => $transfer_scene_report_infos
|
||||
];
|
||||
Log::info("转账数据", $data);
|
||||
$instance = $this->newClient();
|
||||
$resp = $instance->chain('v3/fund-app/mch-transfer/transfer-bills')->post([
|
||||
"json" => $data
|
||||
]);
|
||||
$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];
|
||||
}
|
||||
// try {
|
||||
$appid = config("wechat.official_account.default.app_id");
|
||||
$data = [
|
||||
"appid" => $appid,
|
||||
"out_bill_no" => $trade_no,
|
||||
"transfer_scene_id" => (string) $scene_id,
|
||||
"openid" => $openid,
|
||||
"transfer_amount" => $amount,
|
||||
"transfer_remark" => $remark,
|
||||
"transfer_scene_report_infos" => $transfer_scene_report_infos
|
||||
];
|
||||
Log::info("转账数据", $data);
|
||||
$instance = $this->newClient();
|
||||
$resp = $instance->chain('v3/fund-app/mch-transfer/transfer-bills')->post([
|
||||
"json" => $data
|
||||
]);
|
||||
$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];
|
||||
// }
|
||||
|
||||
return ["code" => 1, "err_msg" => $e->getMessage(), "data" => null];
|
||||
}
|
||||
// return ["code" => 1, "err_msg" => $e->getMessage(), "data" => null];
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user