Skip to content

Commit 06e4dda

Browse files
committed
微信支付计算精度问题 #248
1 parent 00a197a commit 06e4dda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ public Map<String, String> getJSSDKPayInfo(String openId, String outTradeNo, dou
884884
packageParams.put("mch_id", wxMpConfigStorage.getPartnerId());
885885
packageParams.put("body", body);
886886
packageParams.put("out_trade_no", outTradeNo);
887-
packageParams.put("total_fee", (int) (amt * 100) + "");
887+
packageParams.put("total_fee", String.format("%.0f", amt * 100));
888888
packageParams.put("spbill_create_ip", ip);
889889
packageParams.put("notify_url", callbackUrl);
890890
packageParams.put("trade_type", tradeType);

0 commit comments

Comments
 (0)