Format totals to 2dp when doing paypal checks Closes #6678

This commit is contained in:
Mike Jolley 2014-11-14 13:17:17 +00:00
parent 9701dad114
commit 4b5d22b8e8
1 changed files with 1 additions and 1 deletions

View File

@ -810,7 +810,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
}
// 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 ) {
$this->log->add( 'paypal', 'Payment error: Amounts do not match (gross ' . $posted['mc_gross'] . ')' );
}