diff --git a/luoo_user/src/main/java/com/luoo/user/controller/WxPayController.java b/luoo_user/src/main/java/com/luoo/user/controller/WxPayController.java index 13dfb05..b924fff 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/WxPayController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/WxPayController.java @@ -26,6 +26,8 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; @@ -70,13 +72,14 @@ public class WxPayController { params.put("out_trade_no", PayKit.generateStr()); params.put("time_expire", timeExpire); params.put("notify_url", wxPayConfig.getNotifyUrl()); + params.put("amount", new HashMap() {{ - put("total", 0.01); + put("total", 1); put("currency", "CNY"); }}); 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( RequestMethodEnum.POST, WxDomainEnum.CHINA.toString(), @@ -99,12 +102,12 @@ public class WxPayController { Map map = WxPayKit.appCreateSign(wxPayConfig.getAppId(), wxPayConfig.getMchId(), prepayId, wxPayConfig.getPrivateKeyPath()); log.info("唤起支付参数:{}", map); - return Result.success(map); + return Result.success(map); } - return Result.success(response); + return Result.success(response); } catch (Exception e) { e.printStackTrace(); - return Result.failed(e.getMessage()); + return Result.failed(e.getMessage()); } } diff --git a/luoo_user/src/main/resources/bootstrap.yml b/luoo_user/src/main/resources/bootstrap.yml index 3888948..cc8c279 100644 --- a/luoo_user/src/main/resources/bootstrap.yml +++ b/luoo_user/src/main/resources/bootstrap.yml @@ -43,7 +43,7 @@ wx: mchId: 1676389229 mchSerialNo: 541E42E46254E026DE1E1D13602865CE049866C2 apiV3Key: Indiecn2024181189288661529541569 - notifyUri: https://beta.indie.cn/user/wx/pay/payNotify + notifyUrl: https://beta.indie.cn/user/wx/pay/payNotify privateKeyPath: D:\apiclient_key.pem privateCertPath: D:\apiclient_cert.pem platformCertPath: D:\apiclient_cert.pem