|
|
@@ -109,7 +109,7 @@ public class WxMiniAppPayV3AdapterService extends BaseWxPayV3AdapterService impl |
|
|
return req; |
|
|
return req; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private PayAdapterResult getOrderPResult(String response,WxPayOrder record,WxPayAccount payAccount,WxAppinfo appInfo) { |
|
|
|
|
|
|
|
|
private PayAdapterResult getOrderPResult(String response,WxPayOrder record,WxPayAccount payAccount,WxAppinfo appInfo,WxPayService payService) { |
|
|
PayAdapterResult par = new PayAdapterResult(); |
|
|
PayAdapterResult par = new PayAdapterResult(); |
|
|
if (StringUtils.isBlank(response)) { |
|
|
if (StringUtils.isBlank(response)) { |
|
|
par.setSuccess(false); |
|
|
par.setSuccess(false); |
|
|
@@ -125,22 +125,16 @@ public class WxMiniAppPayV3AdapterService extends BaseWxPayV3AdapterService impl |
|
|
par.setMsg("success."); |
|
|
par.setMsg("success."); |
|
|
record.setPrepayId(prepayId); |
|
|
record.setPrepayId(prepayId); |
|
|
record.setUpdateTime(new Date()); |
|
|
record.setUpdateTime(new Date()); |
|
|
par.setData(getPayRetMap(appInfo, prepayId, payAccount, record)); |
|
|
|
|
|
|
|
|
par.setData(getPayRetMap(payService,appInfo, prepayId, payAccount, record)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return par; |
|
|
return par; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private Map getPayRetMap(WxAppinfo appInfo,String prepayId,WxPayAccount payAccount,WxPayOrder record) { |
|
|
|
|
|
|
|
|
private Map getPayRetMap(WxPayService payService,WxAppinfo appInfo,String prepayId,WxPayAccount payAccount,WxPayOrder record) { |
|
|
String timestamp = String.valueOf(Utility.getCurrentTimeStamp()); |
|
|
String timestamp = String.valueOf(Utility.getCurrentTimeStamp()); |
|
|
String noncestr = Utility.generate32UUID(); |
|
|
String noncestr = Utility.generate32UUID(); |
|
|
Map<String, String> sighMap = MapUtil.getOrderMap(); |
|
|
|
|
|
sighMap.put("appId", appInfo.getAppId()); |
|
|
|
|
|
sighMap.put("timeStamp", timestamp); |
|
|
|
|
|
sighMap.put("nonceStr", noncestr); |
|
|
|
|
|
sighMap.put("package", "prepay_id=" + prepayId); |
|
|
|
|
|
sighMap.put("signType", "RSA"); |
|
|
|
|
|
String signAgent = WxPayment.createSignHMAC(sighMap, payAccount.getApiKey()); |
|
|
|
|
|
|
|
|
String signAgent = WxPayV3.getMiniAppPayEntry(payService, appInfo.getAppId(), timestamp, noncestr, prepayId); |
|
|
Map returnMap = new HashMap(); |
|
|
Map returnMap = new HashMap(); |
|
|
returnMap.put("appId", appInfo.getAppId()); |
|
|
returnMap.put("appId", appInfo.getAppId()); |
|
|
returnMap.put("timeStamp", timestamp); |
|
|
returnMap.put("timeStamp", timestamp); |
|
|
@@ -151,6 +145,7 @@ public class WxMiniAppPayV3AdapterService extends BaseWxPayV3AdapterService impl |
|
|
returnMap.put("payOrderId", String.valueOf(record.getId())); |
|
|
returnMap.put("payOrderId", String.valueOf(record.getId())); |
|
|
return returnMap; |
|
|
return returnMap; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private V3CombinePayCommonMiniAppReq generateCombinePayReqeust(WxPayAccount payAccount,WxComposeOrder composeOrder,List<WxOrder> childOrders,String productName, |
|
|
private V3CombinePayCommonMiniAppReq generateCombinePayReqeust(WxPayAccount payAccount,WxComposeOrder composeOrder,List<WxOrder> childOrders,String productName, |
|
|
WxPayOrder record,WxAppinfo appInfo,String openId,String appId,Date currentDate,EnumPayShare isShare) throws Exception { |
|
|
WxPayOrder record,WxAppinfo appInfo,String openId,String appId,Date currentDate,EnumPayShare isShare) throws Exception { |
|
|
@@ -214,7 +209,7 @@ public class WxMiniAppPayV3AdapterService extends BaseWxPayV3AdapterService impl |
|
|
V3PayCommonMiniAppReq payReq = generatePayCommonRequest(payAccount,composeOrder,productName,record,openId,appInfo,currentDate); |
|
|
V3PayCommonMiniAppReq payReq = generatePayCommonRequest(payAccount,composeOrder,productName,record,openId,appInfo,currentDate); |
|
|
try { |
|
|
try { |
|
|
String response = WxPayV3.payCommonWithMiniApp(payService, payReq); |
|
|
String response = WxPayV3.payCommonWithMiniApp(payService, payReq); |
|
|
return getOrderPResult(response,record,payAccount,appInfo); |
|
|
|
|
|
|
|
|
return getOrderPResult(response,record,payAccount,appInfo,payService); |
|
|
}catch(WxPayException e) { |
|
|
}catch(WxPayException e) { |
|
|
log.error("wexin pay v3 error",e); |
|
|
log.error("wexin pay v3 error",e); |
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),e.getCustomErrorMsg()); |
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),e.getCustomErrorMsg()); |
|
|
|