微信支付失败,返回invalid total_fee,原来是金额不能出现小数点

微信支付出现提示:get brand_wcpay_request:fail

支付结果返回:invalid total_fee

[html]  view plain  copy
  1. <xml><return_code><![CDATA[FAIL]]></return_code>  
  2. <return_msg><![CDATA[invalid total_fee]]></return_msg>  
  3. </xml>  
微信支付提交的金额是不能带小数点的,且是以分为单位,所以我们系统如果是以元为单位要处理下金额,即先乘以100,再去小数点

[csharp]  view plain  copy
  1. (Math.Round((decimal)order.Amount * 100, 0)).ToString()  
发布了6 篇原创文章 · 获赞 0 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/manbudezhu/article/details/80695661