This commit is contained in:
2023-04-27 23:01:40 +08:00
parent f5ce28401d
commit 1b9cf62d68
2 changed files with 41 additions and 14 deletions

View File

@@ -81,7 +81,7 @@ public class WxPayController extends AbstractWxPayApiController {
@Resource
private SysAppletSetMapper appletSetMapper;
// private String notifyUrl = "http://java.chengguo.link:8081/api";
// private String notifyUrl = "http://java.chengguo.link:8081/api";
@Value("${wx.notifyUrl}")
private String notifyUrl;
private String refundNotifyUrl;
@@ -287,8 +287,8 @@ public class WxPayController extends AbstractWxPayApiController {
String ip = IpKit.getRealIp(request);
if (StrUtil.isEmpty(ip)) {
ip = "127.0.0.1";
}else {
ip=ip.split(",")[0];
} else {
ip = ip.split(",")[0];
}
OmsOrder orderInfo = orderService.getById(orderId);
@@ -341,7 +341,7 @@ public class WxPayController extends AbstractWxPayApiController {
Map<String, String> packageParams = WxPayKit.prepayIdCreateSign(prepayId, wxPayApiConfig.getAppId(),
wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256);
// String jsonStr = JSON.toJSONString(packageParams);
// String jsonStr = JSON.toJSONString(packageParams);
return new CommonResult().success(packageParams);
} catch (Exception e) {
e.printStackTrace();
@@ -1027,4 +1027,23 @@ public class WxPayController extends AbstractWxPayApiController {
}
return null;
}
public static void main(String[] args) {
Map<String, String> params = RefundModel.builder()
.appid("wxa66597d50184d027")
.mch_id("1513840821")
.nonce_str(WxPayKit.generateStr())
// .transaction_id("")
.out_trade_no("16802424046770100382")
// .out_refund_no(WxPayKit.generateStr())
// .total_fee("2")
// .refund_fee("2")
// .notify_url("http://kfgiis.natappfree.cc/api/wxPay/refundNotify")
.build()
.createSign("381f9ea3359c0e2fc8b74c59d9d9bb11", SignType.MD5);
String b = WxPayApi.orderQuery(params);
System.out.println("b==================:"+b);
// String a = WxPayApi.orderRefund(false, params, "","1513840821");
// System.out.println("a================="+a);
}
}