WC_Gateway_Paypal_IPN_Handler::validate_amount() protected WC 1.0
Check payment amount from IPN matches the order.
{} Это метод класса: WC_Gateway_Paypal_IPN_Handler{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->validate_amount( $order, $amount );
- $order(WC_Order) (обязательный)
- Order object.
- $amount(число) (обязательный)
- Amount to validate.
Код WC_Gateway_Paypal_IPN_Handler::validate_amount() WC Gateway Paypal IPN Handler::validate amount WC 5.0.0
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;
}
}