@Test public void testGetPayInfo() throws Exception { }
@Override @Deprecated public Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request) throws WxPayException { WxPayUnifiedOrderResult unifiedOrderResult = this.unifiedOrder(request); String prepayId = unifiedOrderResult.getPrepayId(); if (StringUtils.isBlank(prepayId)) { throw new RuntimeException(String.format("无法获取prepay id，错误代码： '%s'，信息：%s。", unifiedOrderResult.getErrCode(), unifiedOrderResult.getErrCodeDes())); } Map<String, String> payInfo = new HashMap<>(); String timestamp = String.valueOf(System.currentTimeMillis() / 1000); String nonceStr = String.valueOf(System.currentTimeMillis()); if (TradeType.NATIVE.equals(request.getTradeType())) { payInfo.put("codeUrl", unifiedOrderResult.getCodeURL()); } else if (TradeType.APP.equals(request.getTradeType())) { String appId = getConfig().getAppId(); Map<String, String> configMap = new HashMap<>(); String partnerId = getConfig().getMchId(); configMap.put("prepayid", prepayId); configMap.put("partnerid", partnerId); String packageValue = "Sign=WXPay"; configMap.put("package", packageValue); configMap.put("timestamp", timestamp); configMap.put("noncestr", nonceStr); configMap.put("appid", appId); payInfo.put("sign", SignUtils.createSign(configMap, null, this.getConfig().getMchKey(), false)); payInfo.put("prepayId", prepayId); payInfo.put("partnerId", partnerId); payInfo.put("appId", appId); payInfo.put("packageValue", packageValue); payInfo.put("timeStamp", timestamp); payInfo.put("nonceStr", nonceStr); } else if (TradeType.JSAPI.equals(request.getTradeType())) { payInfo.put("appId", unifiedOrderResult.getAppid()); payInfo.put("timeStamp", timestamp); payInfo.put("nonceStr", nonceStr); payInfo.put("package", "prepay_id=" + prepayId); payInfo.put("signType", SignType.MD5); payInfo.put("paySign", SignUtils.createSign(payInfo, null, this.getConfig().getMchKey(), false)); } return payInfo; }
BaseWxPayServiceImpl implements WxPayService { @Override @Deprecated public Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request) throws WxPayException { WxPayUnifiedOrderResult unifiedOrderResult = this.unifiedOrder(request); String prepayId = unifiedOrderResult.getPrepayId(); if (StringUtils.isBlank(prepayId)) { throw new RuntimeException(String.format("无法获取prepay id，错误代码： '%s'，信息：%s。", unifiedOrderResult.getErrCode(), unifiedOrderResult.getErrCodeDes())); } Map<String, String> payInfo = new HashMap<>(); String timestamp = String.valueOf(System.currentTimeMillis() / 1000); String nonceStr = String.valueOf(System.currentTimeMillis()); if (TradeType.NATIVE.equals(request.getTradeType())) { payInfo.put("codeUrl", unifiedOrderResult.getCodeURL()); } else if (TradeType.APP.equals(request.getTradeType())) { String appId = getConfig().getAppId(); Map<String, String> configMap = new HashMap<>(); String partnerId = getConfig().getMchId(); configMap.put("prepayid", prepayId); configMap.put("partnerid", partnerId); String packageValue = "Sign=WXPay"; configMap.put("package", packageValue); configMap.put("timestamp", timestamp); configMap.put("noncestr", nonceStr); configMap.put("appid", appId); payInfo.put("sign", SignUtils.createSign(configMap, null, this.getConfig().getMchKey(), false)); payInfo.put("prepayId", prepayId); payInfo.put("partnerId", partnerId); payInfo.put("appId", appId); payInfo.put("packageValue", packageValue); payInfo.put("timeStamp", timestamp); payInfo.put("nonceStr", nonceStr); } else if (TradeType.JSAPI.equals(request.getTradeType())) { payInfo.put("appId", unifiedOrderResult.getAppid()); payInfo.put("timeStamp", timestamp); payInfo.put("nonceStr", nonceStr); payInfo.put("package", "prepay_id=" + prepayId); payInfo.put("signType", SignType.MD5); payInfo.put("paySign", SignUtils.createSign(payInfo, null, this.getConfig().getMchKey(), false)); } return payInfo; } }
BaseWxPayServiceImpl implements WxPayService { @Override @Deprecated public Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request) throws WxPayException { WxPayUnifiedOrderResult unifiedOrderResult = this.unifiedOrder(request); String prepayId = unifiedOrderResult.getPrepayId(); if (StringUtils.isBlank(prepayId)) { throw new RuntimeException(String.format("无法获取prepay id，错误代码： '%s'，信息：%s。", unifiedOrderResult.getErrCode(), unifiedOrderResult.getErrCodeDes())); } Map<String, String> payInfo = new HashMap<>(); String timestamp = String.valueOf(System.currentTimeMillis() / 1000); String nonceStr = String.valueOf(System.currentTimeMillis()); if (TradeType.NATIVE.equals(request.getTradeType())) { payInfo.put("codeUrl", unifiedOrderResult.getCodeURL()); } else if (TradeType.APP.equals(request.getTradeType())) { String appId = getConfig().getAppId(); Map<String, String> configMap = new HashMap<>(); String partnerId = getConfig().getMchId(); configMap.put("prepayid", prepayId); configMap.put("partnerid", partnerId); String packageValue = "Sign=WXPay"; configMap.put("package", packageValue); configMap.put("timestamp", timestamp); configMap.put("noncestr", nonceStr); configMap.put("appid", appId); payInfo.put("sign", SignUtils.createSign(configMap, null, this.getConfig().getMchKey(), false)); payInfo.put("prepayId", prepayId); payInfo.put("partnerId", partnerId); payInfo.put("appId", appId); payInfo.put("packageValue", packageValue); payInfo.put("timeStamp", timestamp); payInfo.put("nonceStr", nonceStr); } else if (TradeType.JSAPI.equals(request.getTradeType())) { payInfo.put("appId", unifiedOrderResult.getAppid()); payInfo.put("timeStamp", timestamp); payInfo.put("nonceStr", nonceStr); payInfo.put("package", "prepay_id=" + prepayId); payInfo.put("signType", SignType.MD5); payInfo.put("paySign", SignUtils.createSign(payInfo, null, this.getConfig().getMchKey(), false)); } return payInfo; }  }
BaseWxPayServiceImpl implements WxPayService { @Override @Deprecated public Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request) throws WxPayException { WxPayUnifiedOrderResult unifiedOrderResult = this.unifiedOrder(request); String prepayId = unifiedOrderResult.getPrepayId(); if (StringUtils.isBlank(prepayId)) { throw new RuntimeException(String.format("无法获取prepay id，错误代码： '%s'，信息：%s。", unifiedOrderResult.getErrCode(), unifiedOrderResult.getErrCodeDes())); } Map<String, String> payInfo = new HashMap<>(); String timestamp = String.valueOf(System.currentTimeMillis() / 1000); String nonceStr = String.valueOf(System.currentTimeMillis()); if (TradeType.NATIVE.equals(request.getTradeType())) { payInfo.put("codeUrl", unifiedOrderResult.getCodeURL()); } else if (TradeType.APP.equals(request.getTradeType())) { String appId = getConfig().getAppId(); Map<String, String> configMap = new HashMap<>(); String partnerId = getConfig().getMchId(); configMap.put("prepayid", prepayId); configMap.put("partnerid", partnerId); String packageValue = "Sign=WXPay"; configMap.put("package", packageValue); configMap.put("timestamp", timestamp); configMap.put("noncestr", nonceStr); configMap.put("appid", appId); payInfo.put("sign", SignUtils.createSign(configMap, null, this.getConfig().getMchKey(), false)); payInfo.put("prepayId", prepayId); payInfo.put("partnerId", partnerId); payInfo.put("appId", appId); payInfo.put("packageValue", packageValue); payInfo.put("timeStamp", timestamp); payInfo.put("nonceStr", nonceStr); } else if (TradeType.JSAPI.equals(request.getTradeType())) { payInfo.put("appId", unifiedOrderResult.getAppid()); payInfo.put("timeStamp", timestamp); payInfo.put("nonceStr", nonceStr); payInfo.put("package", "prepay_id=" + prepayId); payInfo.put("signType", SignType.MD5); payInfo.put("paySign", SignUtils.createSign(payInfo, null, this.getConfig().getMchKey(), false)); } return payInfo; }  @Override EntPayService getEntPayService(); @Override void setEntPayService(EntPayService entPayService); @Override WxPayConfig getConfig(); @Override void setConfig(WxPayConfig config); @Override String getPayBaseUrl(); @Override WxPayRefundResult refund(WxPayRefundRequest request); @Override WxPayRefundQueryResult refundQuery(String transactionId, String outTradeNo, String outRefundNo, String refundId); @Override WxPayRefundQueryResult refundQuery(WxPayRefundQueryRequest request); @Override WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData); @Override WxPayRefundNotifyResult parseRefundNotifyResult(String xmlData); @Override WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData); @Override WxPaySendRedpackResult sendRedpack(WxPaySendRedpackRequest request); @Override WxPayRedpackQueryResult queryRedpack(String mchBillNo); @Override WxPayOrderQueryResult queryOrder(String transactionId, String outTradeNo); @Override WxPayOrderQueryResult queryOrder(WxPayOrderQueryRequest request); @Override WxPayOrderCloseResult closeOrder(String outTradeNo); @Override WxPayOrderCloseResult closeOrder(WxPayOrderCloseRequest request); @Override T createOrder(WxPayUnifiedOrderRequest request); @Override WxPayUnifiedOrderResult unifiedOrder(WxPayUnifiedOrderRequest request); @Override @Deprecated Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request); @Override byte[] createScanPayQrcodeMode1(String productId, File logoFile, Integer sideLength); @Override String createScanPayQrcodeMode1(String productId); @Override byte[] createScanPayQrcodeMode2(String codeUrl, File logoFile, Integer sideLength); @Override void report(WxPayReportRequest request); @Override WxPayBillResult downloadBill(String billDate, String billType, String tarType, String deviceInfo); @Override WxPayBillResult downloadBill(WxPayDownloadBillRequest request); @Override WxPayMicropayResult micropay(WxPayMicropayRequest request); @Override WxPayOrderReverseResult reverseOrder(WxPayOrderReverseRequest request); @Override String shorturl(WxPayShorturlRequest request); @Override String shorturl(String longUrl); @Override String authcode2Openid(WxPayAuthcode2OpenidRequest request); @Override String authcode2Openid(String authCode); @Override String getSandboxSignKey(); @Override WxPayCouponSendResult sendCoupon(WxPayCouponSendRequest request); @Override WxPayCouponStockQueryResult queryCouponStock(WxPayCouponStockQueryRequest request); @Override WxPayCouponInfoQueryResult queryCouponInfo(WxPayCouponInfoQueryRequest request); @Override WxPayApiData getWxApiData(); @Override String queryComment(Date beginDate, Date endDate, Integer offset, Integer limit); }
BaseWxPayServiceImpl implements WxPayService { @Override @Deprecated public Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request) throws WxPayException { WxPayUnifiedOrderResult unifiedOrderResult = this.unifiedOrder(request); String prepayId = unifiedOrderResult.getPrepayId(); if (StringUtils.isBlank(prepayId)) { throw new RuntimeException(String.format("无法获取prepay id，错误代码： '%s'，信息：%s。", unifiedOrderResult.getErrCode(), unifiedOrderResult.getErrCodeDes())); } Map<String, String> payInfo = new HashMap<>(); String timestamp = String.valueOf(System.currentTimeMillis() / 1000); String nonceStr = String.valueOf(System.currentTimeMillis()); if (TradeType.NATIVE.equals(request.getTradeType())) { payInfo.put("codeUrl", unifiedOrderResult.getCodeURL()); } else if (TradeType.APP.equals(request.getTradeType())) { String appId = getConfig().getAppId(); Map<String, String> configMap = new HashMap<>(); String partnerId = getConfig().getMchId(); configMap.put("prepayid", prepayId); configMap.put("partnerid", partnerId); String packageValue = "Sign=WXPay"; configMap.put("package", packageValue); configMap.put("timestamp", timestamp); configMap.put("noncestr", nonceStr); configMap.put("appid", appId); payInfo.put("sign", SignUtils.createSign(configMap, null, this.getConfig().getMchKey(), false)); payInfo.put("prepayId", prepayId); payInfo.put("partnerId", partnerId); payInfo.put("appId", appId); payInfo.put("packageValue", packageValue); payInfo.put("timeStamp", timestamp); payInfo.put("nonceStr", nonceStr); } else if (TradeType.JSAPI.equals(request.getTradeType())) { payInfo.put("appId", unifiedOrderResult.getAppid()); payInfo.put("timeStamp", timestamp); payInfo.put("nonceStr", nonceStr); payInfo.put("package", "prepay_id=" + prepayId); payInfo.put("signType", SignType.MD5); payInfo.put("paySign", SignUtils.createSign(payInfo, null, this.getConfig().getMchKey(), false)); } return payInfo; }  @Override EntPayService getEntPayService(); @Override void setEntPayService(EntPayService entPayService); @Override WxPayConfig getConfig(); @Override void setConfig(WxPayConfig config); @Override String getPayBaseUrl(); @Override WxPayRefundResult refund(WxPayRefundRequest request); @Override WxPayRefundQueryResult refundQuery(String transactionId, String outTradeNo, String outRefundNo, String refundId); @Override WxPayRefundQueryResult refundQuery(WxPayRefundQueryRequest request); @Override WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData); @Override WxPayRefundNotifyResult parseRefundNotifyResult(String xmlData); @Override WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData); @Override WxPaySendRedpackResult sendRedpack(WxPaySendRedpackRequest request); @Override WxPayRedpackQueryResult queryRedpack(String mchBillNo); @Override WxPayOrderQueryResult queryOrder(String transactionId, String outTradeNo); @Override WxPayOrderQueryResult queryOrder(WxPayOrderQueryRequest request); @Override WxPayOrderCloseResult closeOrder(String outTradeNo); @Override WxPayOrderCloseResult closeOrder(WxPayOrderCloseRequest request); @Override T createOrder(WxPayUnifiedOrderRequest request); @Override WxPayUnifiedOrderResult unifiedOrder(WxPayUnifiedOrderRequest request); @Override @Deprecated Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request); @Override byte[] createScanPayQrcodeMode1(String productId, File logoFile, Integer sideLength); @Override String createScanPayQrcodeMode1(String productId); @Override byte[] createScanPayQrcodeMode2(String codeUrl, File logoFile, Integer sideLength); @Override void report(WxPayReportRequest request); @Override WxPayBillResult downloadBill(String billDate, String billType, String tarType, String deviceInfo); @Override WxPayBillResult downloadBill(WxPayDownloadBillRequest request); @Override WxPayMicropayResult micropay(WxPayMicropayRequest request); @Override WxPayOrderReverseResult reverseOrder(WxPayOrderReverseRequest request); @Override String shorturl(WxPayShorturlRequest request); @Override String shorturl(String longUrl); @Override String authcode2Openid(WxPayAuthcode2OpenidRequest request); @Override String authcode2Openid(String authCode); @Override String getSandboxSignKey(); @Override WxPayCouponSendResult sendCoupon(WxPayCouponSendRequest request); @Override WxPayCouponStockQueryResult queryCouponStock(WxPayCouponStockQueryRequest request); @Override WxPayCouponInfoQueryResult queryCouponInfo(WxPayCouponInfoQueryRequest request); @Override WxPayApiData getWxApiData(); @Override String queryComment(Date beginDate, Date endDate, Integer offset, Integer limit);  }