|
|
|
@@ -79,16 +79,12 @@ public class WxPayV3 { |
|
|
|
|
|
|
|
//小程序下单支付签名 |
|
|
|
public static String getMiniAppPayEntry(WxPayService payService,String appId,String timestamp,String noncestr,String prepayId) { |
|
|
|
Map<String, String> sighMap = new HashMap(); |
|
|
|
sighMap.put("appId", appId+"\n"); |
|
|
|
sighMap.put("timeStamp", timestamp+"\n"); |
|
|
|
sighMap.put("nonceStr", noncestr+"\n"); |
|
|
|
sighMap.put("package", "prepay_id=" + prepayId+"\n"); |
|
|
|
StringBuffer sb = new StringBuffer(); |
|
|
|
sb.append(appId).append("\n").append(timestamp).append("\n").append(noncestr).append("\n").append("prepay_id=").append(prepayId).append("\n"); |
|
|
|
WxPayConfig config = payService.getConfig(); |
|
|
|
//初始化 |
|
|
|
config.getVerifier(); |
|
|
|
String content = JSON.toJSONString(sighMap); |
|
|
|
return new PrivateKeySigner(config.getCertSerialNo(), config.getPrivateKey()).signMessage(content.getBytes(StandardCharsets.UTF_8)); |
|
|
|
return new PrivateKeySigner(config.getCertSerialNo(), config.getPrivateKey()).signMessage(sb.toString().getBytes(StandardCharsets.UTF_8)); |
|
|
|
} |
|
|
|
|
|
|
|
//敏感信息加密 |
|
|
|
|