mirror of
https://gitee.com/liuxioabin/fengketrade.git
synced 2026-04-17 12:57:32 +08:00
签名修复
This commit is contained in:
parent
278bc2ab03
commit
25814edcff
@ -123,10 +123,6 @@ class Ccbpayment extends Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 5. 生成支付串(步骤3:调用收银台)
|
// 5. 生成支付串(步骤3:调用收银台)
|
||||||
// ⚠️ 注意: generatePaymentString()内部已经完成了以下操作:
|
|
||||||
// - 更新订单的ccb_pay_flow_id字段(幂等操作,重复更新不影响)
|
|
||||||
// - 记录支付日志到ccb_payment_log表
|
|
||||||
// 控制器不应该重复操作,否则会导致数据重复写入!
|
|
||||||
$result = $this->paymentService->generatePaymentString($orderId, $payFlowId);
|
$result = $this->paymentService->generatePaymentString($orderId, $payFlowId);
|
||||||
|
|
||||||
if (!$result['status']) {
|
if (!$result['status']) {
|
||||||
|
|||||||
@ -122,22 +122,11 @@ class CcbPaymentService
|
|||||||
|
|
||||||
$macParams['REFERER'] = ''; // 商户URL(空字符串)
|
$macParams['REFERER'] = ''; // 商户URL(空字符串)
|
||||||
|
|
||||||
// ⚠️ 关键修复:INSTALLNUM必须在THIRDAPPINFO之前(严格按照文档4.1表格顺序)
|
// ✅ 修复:严格按照文档4.1表格顺序添加必填字段
|
||||||
// 1.3 可选参数(按文档表格顺序,有值才参与MAC)
|
// THIRDAPPINFO必须在INSTALLNUM之前(第17位基础字段)
|
||||||
// 注意:根据文档4.2,橙色字段有值时才参与MAC,空值不参与
|
|
||||||
|
|
||||||
// 分期期数(在REFERER之后,THIRDAPPINFO之前)
|
|
||||||
if (!empty($this->config['install_num'])) {
|
|
||||||
$macParams['INSTALLNUM'] = $this->config['install_num'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$macParams['THIRDAPPINFO'] = 'comccbpay1234567890cloudmerchant'; // 客户端标识(固定值)
|
$macParams['THIRDAPPINFO'] = 'comccbpay1234567890cloudmerchant'; // 客户端标识(固定值)
|
||||||
|
|
||||||
// 记录关键参数
|
// 超时时间(第18位基础字段,必填)
|
||||||
Log::info('[建行支付] 关键参数 order_id:' . $orderId . ' pay_flow_id:' . $payFlowId . ' user_orderid:' . $order['order_sn'] . ' payment:' . $payment);
|
|
||||||
Log::info('[建行支付] 商户信息 merchant_id:' . ($macParams['MERCHANTID'] ?? 'N/A') . ' pos_id:' . ($macParams['POSID'] ?? 'N/A') . ' branch_id:' . ($macParams['BRANCHID'] ?? 'N/A'));
|
|
||||||
|
|
||||||
// 超时时间
|
|
||||||
if (!empty($this->config['timeout'])) {
|
if (!empty($this->config['timeout'])) {
|
||||||
$macParams['TIMEOUT'] = $this->config['timeout'];
|
$macParams['TIMEOUT'] = $this->config['timeout'];
|
||||||
} else {
|
} else {
|
||||||
@ -145,6 +134,18 @@ class CcbPaymentService
|
|||||||
$macParams['TIMEOUT'] = date('YmdHis', strtotime('+30 minutes'));
|
$macParams['TIMEOUT'] = date('YmdHis', strtotime('+30 minutes'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 记录关键参数
|
||||||
|
Log::info('[建行支付] 关键参数 order_id:' . $orderId . ' pay_flow_id:' . $payFlowId . ' user_orderid:' . $order['order_sn'] . ' payment:' . $payment);
|
||||||
|
Log::info('[建行支付] 商户信息 merchant_id:' . ($macParams['MERCHANTID'] ?? 'N/A') . ' pos_id:' . ($macParams['POSID'] ?? 'N/A') . ' branch_id:' . ($macParams['BRANCHID'] ?? 'N/A'));
|
||||||
|
|
||||||
|
// ========== ✅ 以下为可选参数(第19+位),按文档表格顺序添加 ==========
|
||||||
|
// 注意:根据文档4.2,橙色字段有值时才参与MAC,空值不参与
|
||||||
|
|
||||||
|
// 分期期数(第19位,可选参数)
|
||||||
|
if (!empty($this->config['install_num'])) {
|
||||||
|
$macParams['INSTALLNUM'] = $this->config['install_num'];
|
||||||
|
}
|
||||||
|
|
||||||
// 中国建设银行App环境参数
|
// 中国建设银行App环境参数
|
||||||
// if (!empty($this->config['user_id'])) {
|
// if (!empty($this->config['user_id'])) {
|
||||||
// $macParams['USERID'] = $this->config['user_id'];
|
// $macParams['USERID'] = $this->config['user_id'];
|
||||||
@ -329,7 +330,6 @@ class CcbPaymentService
|
|||||||
'message' => '支付串生成成功',
|
'message' => '支付串生成成功',
|
||||||
'data' => [
|
'data' => [
|
||||||
'payment_string' => $finalPaymentString,
|
'payment_string' => $finalPaymentString,
|
||||||
// 'payment_string' => 'MERCHANTID=105003953998037&POSID=068295530&BRANCHID=340650000&ORDERID=PAY20251027163247893442&USER_ORDERID=202504324734011387001000&PAYMENT=2999.00&CURCODE=01&TXCODE=520100&REMARK1=&REMARK2=YS44000009001853&TYPE=1&GATEWAY=0&CLIENTIP=®INFO=&PROINFO=Apple%u0020Watch%u0020Series%u00207%u0020%u667A%u80FD%u624B%u8868GPS%u6B3E41%u0020%u6BEB%u7C73%u661F%u5149%u8272%u94DD%u91D1%u5C5E%u8868%u58F3%u661F%u5149%u8272%u8FD0%u52A8%u578B%u8868%u5E26&REFERER=&THIRDAPPINFO=comccbpay1234567890cloudmerchant&TIMEOUT=20251027172350&PLATFORMPUB=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6yZj5rUHz+plEbTMSxF6iRy5XTd82LpKGkcRtJcNiHXAvOh/QvW6xc+GJSfvfM9pnRCyWkFrvFViOGnLUrjyoB0wa/TEqWootEEKXSDacFyQ/QIJSK0+zMYTC2Md6gGA4YylJQuYZ1lWDoOLBt9pP93Qnm0R2PEQ5a11HxwdvlQIDAQAB',
|
|
||||||
'mac' => $mac,
|
'mac' => $mac,
|
||||||
'order_sn' => $order['order_sn'],
|
'order_sn' => $order['order_sn'],
|
||||||
'pay_flow_id' => $payFlowId,
|
'pay_flow_id' => $payFlowId,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user