WC_Gateway_Paypal_IPN_Handler::validate_receiver_email
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.
Method of the class: WC_Gateway_Paypal_IPN_Handler{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->validate_receiver_email( $order, $receiver_email );
- $order(WC_Order) (required)
- Order object.
- $receiver_email(string) (required)
- Email to validate.
WC_Gateway_Paypal_IPN_Handler::validate_receiver_email() WC Gateway Paypal IPN Handler::validate receiver email code WC 10.6.2
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( OrderStatus::ON_HOLD, sprintf( __( 'Validation error: PayPal IPN response from a different email address (%s).', 'woocommerce' ), $receiver_email ) );
exit;
}
}