Format totals to 2dp when doing paypal checks Closes #6678
This commit is contained in:
parent
9701dad114
commit
4b5d22b8e8
|
@ -810,7 +810,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate amount
|
// Validate amount
|
||||||
if ( $order->get_total() != $posted['mc_gross'] ) {
|
if ( number_format( $order->get_total(), 2, '.', '' ) != number_format( $posted['mc_gross'] 2, '.', '' ) ) {
|
||||||
if ( 'yes' == $this->debug ) {
|
if ( 'yes' == $this->debug ) {
|
||||||
$this->log->add( 'paypal', 'Payment error: Amounts do not match (gross ' . $posted['mc_gross'] . ')' );
|
$this->log->add( 'paypal', 'Payment error: Amounts do not match (gross ' . $posted['mc_gross'] . ')' );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue