Skip to content

Commit

Permalink
Make PDT validation use the same rounding as the IPN validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
kloon authored and claudiulodro committed Nov 28, 2018
1 parent 38f3268 commit 31a0179
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -106,7 +106,7 @@ public function check_response() {
update_post_meta( $order->get_id(), '_transaction_id', $transaction );

if ( 'completed' === $status ) {
if ( $order->get_total() !== $amount ) {
if ( number_format( $order->get_total(), 2, '.', '' ) !== number_format( $amount, 2, '.', '' ) ) {
WC_Gateway_Paypal::log( 'Payment error: Amounts do not match (amt ' . $amount . ')', 'error' );
/* translators: 1: Payment amount */
$this->payment_on_hold( $order, sprintf( __( 'Validation error: PayPal amounts do not match (amt %s).', 'woocommerce' ), $amount ) );
Expand Down

0 comments on commit 31a0179

Please sign in to comment.