Merge pull request #21729 from woocommerce/update/21627
Make PDT validation use the same rounding as the IPN validation.
This commit is contained in:
commit
1dd4ba0af6
|
@ -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 ) );
|
||||
|
|
Loading…
Reference in New Issue