|
|
@@ -929,7 +929,12 @@ public class PayScoreServiceImpl implements PayScoreService {
|
|
|
SecretKeySpec secretKey = new SecretKeySpec(keyBytes, "HmacSHA256");
|
|
|
mac.init(secretKey);
|
|
|
byte[] signBytes = mac.doFinal(signMessage.getBytes(StandardCharsets.UTF_8));
|
|
|
- sign = Base64.getEncoder().encodeToString(signBytes);
|
|
|
+ // openBusinessView 签名要求大写十六进制,不是 Base64
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ for (byte b : signBytes) {
|
|
|
+ sb.append(String.format("%02X", b));
|
|
|
+ }
|
|
|
+ sign = sb.toString();
|
|
|
} catch (Exception e) {
|
|
|
log.error("[支付分服务] 生成openBusinessView签名失败", e);
|
|
|
throw new RuntimeException("生成签名失败", e);
|