release- 修改金额

release-2024-04-25
huangyw 2 months ago
parent 3e344d0231
commit 6b58503bcb

@ -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(),

@ -43,7 +43,7 @@ wx:
mchId: 1676389229 mchId: 1676389229
mchSerialNo: 541E42E46254E026DE1E1D13602865CE049866C2 mchSerialNo: 541E42E46254E026DE1E1D13602865CE049866C2
apiV3Key: Indiecn2024181189288661529541569 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 privateKeyPath: D:\apiclient_key.pem
privateCertPath: D:\apiclient_cert.pem privateCertPath: D:\apiclient_cert.pem
platformCertPath: D:\apiclient_cert.pem platformCertPath: D:\apiclient_cert.pem

Loading…
Cancel
Save