|
|
@ -26,6 +26,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
@ -70,13 +72,14 @@ public class WxPayController {
|
|
|
|
params.put("out_trade_no", PayKit.generateStr());
|
|
|
|
params.put("out_trade_no", PayKit.generateStr());
|
|
|
|
params.put("time_expire", timeExpire);
|
|
|
|
params.put("time_expire", timeExpire);
|
|
|
|
params.put("notify_url", wxPayConfig.getNotifyUrl());
|
|
|
|
params.put("notify_url", wxPayConfig.getNotifyUrl());
|
|
|
|
|
|
|
|
|
|
|
|
params.put("amount", new HashMap<String, Object>() {{
|
|
|
|
params.put("amount", new HashMap<String, Object>() {{
|
|
|
|
put("total", 0.01);
|
|
|
|
put("total", 1);
|
|
|
|
put("currency", "CNY");
|
|
|
|
put("currency", "CNY");
|
|
|
|
}});
|
|
|
|
}});
|
|
|
|
|
|
|
|
|
|
|
|
log.info("统一下单参数 {}", JSONUtil.toJsonStr(params));
|
|
|
|
log.info("统一下单参数 {}", JSONUtil.toJsonStr(params));
|
|
|
|
redisUtils.set(params.get("out_trade_no").toString(), params);
|
|
|
|
// redisUtils.set(params.get("out_trade_no").toString(), params);
|
|
|
|
IJPayHttpResponse response = WxPayApi.v3(
|
|
|
|
IJPayHttpResponse response = WxPayApi.v3(
|
|
|
|
RequestMethodEnum.POST,
|
|
|
|
RequestMethodEnum.POST,
|
|
|
|
WxDomainEnum.CHINA.toString(),
|
|
|
|
WxDomainEnum.CHINA.toString(),
|
|
|
|