1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
public ResponseResult<String> appPay(HttpServletRequest request, String totalFee, String orderNumber) { String data = rs.opsForValue().get(RedisKey.PAY_WEIXIN_PAY_PARAM); if (data == null) { return ResponseResult.error(ResponseCode.SERVER_ERROR); } PayWayInfoEntity payWayInfoEntity = JSONObject.parseObject(data, PayWayInfoEntity.class); Map<String, String> result = getWexinResult(request, TradeType.APP.getTradeType(), totalFee, null, orderNumber, payWayInfoEntity); log.info(result); ResponseResult<String> returnMsg = resultJudge(result); if (returnMsg != null) { return returnMsg; } String prepayId = result.get("prepay_id"); Map<String, String> packageParams = WxPayKit.appPrepayIdCreateSign(payWayInfoEntity.getAppId(), payWayInfoEntity.getMchId(), prepayId, payWayInfoEntity.getPartnerKey(), SignType.HMACSHA256); String jsonStr = JSON.toJSONString(packageParams); log.info("返回apk的参数:" + jsonStr); return ResponseResult.success(jsonStr); }
|