WC_Gateway_Paypal_IPN_Handler::validate_receiver_email()protectedWC 1.0

Check receiver email from PayPal. If the receiver email in the IPN is different than what is stored in. WooCommerce -> Settings -> Checkout -> PayPal, it will log an error about it.

Метод класса: WC_Gateway_Paypal_IPN_Handler{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->validate_receiver_email( $order, $receiver_email );
$order(WC_Order) (обязательный)
Order object.
$receiver_email(строка) (обязательный)
Email to validate.

Код WC_Gateway_Paypal_IPN_Handler::validate_receiver_email() WC 8.7.0

protected function validate_receiver_email( $order, $receiver_email ) {
	if ( strcasecmp( trim( $receiver_email ), trim( $this->receiver_email ) ) !== 0 ) {
		WC_Gateway_Paypal::log( "IPN Response is for another account: {$receiver_email}. Your email is {$this->receiver_email}" );

		/* translators: %s: email address . */
		$order->update_status( 'on-hold', sprintf( __( 'Validation error: PayPal IPN response from a different email address (%s).', 'woocommerce' ), $receiver_email ) );
		exit;
	}
}