Merge pull request #21729 from woocommerce/update/21627

Make PDT validation use the same rounding as the IPN validation.
This commit is contained in:
Claudiu Lodromanean 2018-10-29 11:44:53 -07:00 committed by GitHub
commit 1dd4ba0af6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ class WC_Gateway_Paypal_PDT_Handler extends WC_Gateway_Paypal_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 ) );