fix(pay): 尝试在签名中包含sign_type字段\n\n- 彩虹易支付签名规则可能要求包含sign_type字段\n- 修改buildSign函数:只跳过sign字段,保留sign_type\n- 此为诊断性修改,若仍失败需改回排除sign_type
This commit is contained in:
+2
-2
@@ -145,12 +145,12 @@ function opensslLoadKey($pem, $isPrivate) {
|
||||
}
|
||||
|
||||
/**
|
||||
* RSA(SHA256withRSA) 请求签名:取全部非空参数 → 剔除 sign/sign_type → 参数名 ASCII 升序 → 原始值 k=v& 拼接 → 私钥签名
|
||||
* RSA(SHA256withRSA) 请求签名:取全部非空参数 → 剔除 sign → 参数名 ASCII 升序 → 原始值 k=v& 拼接 → 私钥签名
|
||||
*/
|
||||
function buildSign($params, $privateKeyPem) {
|
||||
$filtered = [];
|
||||
foreach ($params as $k => $v) {
|
||||
if ($k === 'sign' || $k === 'sign_type') continue;
|
||||
if ($k === 'sign') continue; // 只跳过sign字段,保留sign_type
|
||||
if ($v === '' || $v === null) continue;
|
||||
$filtered[$k] = $v;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user