WC_Gateway_Paypal_IPN_Handler::check_response │ public │ WC 1.0

Check for PayPal IPN Response.

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

Хуки из метода

Возвращает

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

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

$WC_Gateway_Paypal_IPN_Handler = new WC_Gateway_Paypal_IPN_Handler();
$WC_Gateway_Paypal_IPN_Handler->check_response();

Код WC_Gateway_Paypal_IPN_Handler::check_response() WC 11.2.2

public function check_response() {
	if ( ! empty( $_POST ) && $this->validate_ipn() ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- PayPal posts the IPN from its own servers, so no site nonce exists; validate_ipn() echoes the payload back to PayPal and only a VERIFIED response allows processing to continue.
		$posted = wp_unslash( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing -- PayPal posts the IPN from its own servers, so no site nonce exists; the payload is only read after validate_ipn() confirms it, and each value is sanitized where it is consumed.

		// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
		do_action( 'valid-paypal-standard-ipn-request', $posted );
		exit;
	}

	wp_die( 'PayPal IPN Request Failure', 'PayPal IPN', array( 'response' => 500 ) );
}