mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-23 20:00:27 +08:00
修正微信支付验证浮点数精度丢失问题
This commit is contained in:
parent
4bba205420
commit
7ac456bb67
@ -185,7 +185,12 @@ class Wxpay extends PayService
|
|||||||
|
|
||||||
if (!$trade) return false;
|
if (!$trade) return false;
|
||||||
|
|
||||||
if ($data->total_fee != 100 * $trade->amount) {
|
/**
|
||||||
|
* 注意浮点数精度丢失问题
|
||||||
|
*/
|
||||||
|
$amount = intval(strval(100 * $trade->amount));
|
||||||
|
|
||||||
|
if ($data->total_fee != $amount) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user