mirror of
https://gitee.com/liuxioabin/fengketrade.git
synced 2026-04-17 21:03:17 +08:00
up
This commit is contained in:
parent
a4945b8114
commit
2ecb1eca63
@ -242,7 +242,7 @@ class CcbHttpClient
|
||||
}
|
||||
|
||||
// 检查业务响应码
|
||||
// $this->checkBusinessResponse($decryptedData);
|
||||
$this->checkBusinessResponse($decryptedData);
|
||||
|
||||
return $decryptedData;
|
||||
}
|
||||
@ -260,18 +260,16 @@ class CcbHttpClient
|
||||
throw new \Exception('响应数据结构错误:缺少CLD_HEADER');
|
||||
}
|
||||
|
||||
// 优先检查 CLD_HEADER.CLD_TX_RESP(建行新版错误响应)
|
||||
// 检查 CLD_HEADER.CLD_TX_RESP(建行标准响应格式)
|
||||
if (isset($data['CLD_HEADER']['CLD_TX_RESP'])) {
|
||||
$txResp = $data['CLD_HEADER']['CLD_TX_RESP'];
|
||||
$errorCode = isset($txResp['CLD_CODE']) ? $txResp['CLD_CODE'] : 'UNKNOWN';
|
||||
$errorDesc = isset($txResp['CLD_DESC']) ? $txResp['CLD_DESC'] : '未知错误';
|
||||
$code = isset($txResp['CLD_CODE']) ? $txResp['CLD_CODE'] : 'UNKNOWN';
|
||||
$desc = isset($txResp['CLD_DESC']) ? $txResp['CLD_DESC'] : '未知错误';
|
||||
|
||||
throw new \Exception('建行业务错误[' . $errorCode . ']: ' . $errorDesc);
|
||||
}
|
||||
|
||||
// 检查 CLD_BODY 是否存在
|
||||
if (!isset($data['CLD_BODY'])) {
|
||||
throw new \Exception('响应数据结构错误:缺少CLD_BODY');
|
||||
// 只有非成功状态才抛出异常
|
||||
if ($code !== 'CLD_SUCCESS') {
|
||||
throw new \Exception('建行业务错误[' . $code . ']: ' . $desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user