mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Add round precision to diff
This commit is contained in:
parent
8a639e28d1
commit
6b84a66a48
1 changed files with 1 additions and 1 deletions
|
@ -350,7 +350,7 @@ class PayUponInvoiceOrderEndpoint {
|
|||
$shipping = floatval($data['purchase_units'][0]['amount']['breakdown']['shipping']['value']);
|
||||
$tax_total = floatval($data['purchase_units'][0]['amount']['breakdown']['tax_total']['value']);
|
||||
$total_breakdown = $item_total + $shipping + $tax_total;
|
||||
$diff = round($total_amount - $total_breakdown);
|
||||
$diff = round($total_amount - $total_breakdown, 2);
|
||||
if($diff === -0.01 || $diff === 0.01) {
|
||||
$data['purchase_units'][0]['amount']['value'] = number_format( $total_breakdown, 2, '.', '' );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue