mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix rounding when checking total mismatch
This commit is contained in:
parent
ff19c78d3a
commit
0e82a5f6c9
2 changed files with 5 additions and 3 deletions
|
@ -393,8 +393,9 @@ class PurchaseUnit {
|
|||
$amount_total += $insurance->value();
|
||||
}
|
||||
|
||||
$amount_value = $amount->value();
|
||||
$needs_to_ditch = (string) $amount_total !== (string) $amount_value;
|
||||
$amount_str = (string) $amount->to_array()['value'];
|
||||
$amount_total_str = (string) ( new Money( $amount_total, $amount->currency_code() ) )->to_array()['value'];
|
||||
$needs_to_ditch = $amount_str !== $amount_total_str;
|
||||
return $needs_to_ditch;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue