WC_Gateway_Paypal_IPN_Handler::validate_amount()
Check payment amount from IPN matches the order.
Метод класса: WC_Gateway_Paypal_IPN_Handler{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->validate_amount( $order, $amount );
- $order(WC_Order) (обязательный)
- Order object.
- $amount(int) (обязательный)
- Amount to validate.
Код WC_Gateway_Paypal_IPN_Handler::validate_amount() WC Gateway Paypal IPN Handler::validate amount WC 9.5.1
protected function validate_amount( $order, $amount ) { if ( number_format( $order->get_total(), 2, '.', '' ) !== number_format( $amount, 2, '.', '' ) ) { WC_Gateway_Paypal::log( 'Payment error: Amounts do not match (gross ' . $amount . ')' ); /* translators: %s: Amount. */ $order->update_status( 'on-hold', sprintf( __( 'Validation error: PayPal amounts do not match (gross %s).', 'woocommerce' ), $amount ) ); exit; } }