diff --git a/commerce_paypal.module b/commerce_paypal.module
index 8767833..0d23495 100644
--- a/commerce_paypal.module
+++ b/commerce_paypal.module
@@ -14,7 +14,7 @@ function commerce_paypal_menu() {
 
   // Define an always accessible path to receive IPNs.
   $items['commerce_paypal/ipn'] = array(
-    'page callback' => 'commerce_paypal_process_ipn',
+    'page callback' => 'commerce_paypal_process_ipn_page',
     'page arguments' => array(),
     'access callback' => TRUE,
     'type' => MENU_CALLBACK,
@@ -22,7 +22,7 @@ function commerce_paypal_menu() {
 
   // Define an additional IPN path that is payment method / instance specific.
   $items['commerce_paypal/ipn/%commerce_payment_method_instance'] = array(
-    'page callback' => 'commerce_paypal_process_ipn',
+    'page callback' => 'commerce_paypal_process_ipn_page',
     'page arguments' => array(2),
     'access callback' => TRUE,
     'type' => MENU_CALLBACK,
@@ -51,6 +51,24 @@ function commerce_paypal_ipn_url($instance_id = NULL) {
 }

 /**
+ * Page callback to processes an incoming IPN.
+ *
+ * @param string $payment_method
+ *   The payment method instance array that originally made the payment.
+ * @param array $debug_ipn
+ *   Optionally specify an IPN array for debug purposes; if left empty, the IPN
+ *     be pulled from the $_POST. If an IPN is passed in, validation of the IPN
+ *     at PayPal will be bypassed.
+ */
+function commerce_paypal_process_ipn_page($payment_method = NULL, $debug_ipn = array()) {
+  if (commerce_paypal_process_ipn($payment_method, $debug_ipn) === FALSE) {
+    // Set http error code if IPN was not successfully processed.
+    drupal_add_http_header('status', '400 Bad request');
+  }
+  drupal_exit();
+}
+
+/**
  * Processes an incoming IPN.
  *
  * @param $payment_method
