WC_Gateway_Paypal_IPN_Handler::check_response()publicWC 1.0

Check for PayPal IPN Response.

Method of the class: WC_Gateway_Paypal_IPN_Handler{}

Hooks from the method

Return

null. Nothing (null).

Usage

$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() code WC 9.6.1

public function check_response() {
	if ( ! empty( $_POST ) && $this->validate_ipn() ) { // WPCS: CSRF ok.
		$posted = wp_unslash( $_POST ); // WPCS: CSRF ok, input var ok.

		// 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 ) );
}