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.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<String, Object>() {{
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<String, String> 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());
}
}

@ -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

Loading…
Cancel
Save