diff --git a/commerce_be2bill.module b/commerce_be2bill.module
index 7462571..45f2a13 100644
--- a/commerce_be2bill.module
+++ b/commerce_be2bill.module
@@ -187,13 +187,21 @@ function commerce_be2bill_post_return() {
             $transaction->message = t('The payment has completed.');
             break;
         }
+        commerce_payment_redirect_pane_next_page($order);
       }
       else {
+        // Redirect the user to the previous page with an error message containing the return code.
         $transaction->status = COMMERCE_PAYMENT_STATUS_FAILURE;
         $transaction->message = t("The payment has failed.");
+        drupal_set_message(t('There was an error with your payment. Please try again or contact your bank.'), 'error');
+        watchdog('commerce_be2bill', 'Be2Bill payment failure on the order @orderid: [@code] - @return_text.', array(
+          '@orderid' => $response['ORDERID'],
+          '@code' => "{$response['EXECCODE']}",
+          '@return_text' => $response['MESSAGE'],
+        ), WATCHDOG_WARNING);
+        commerce_payment_redirect_pane_previous_page($order);
       }
       commerce_payment_transaction_save($transaction);
-      commerce_payment_redirect_pane_next_page($order);
       drupal_goto(commerce_checkout_order_uri($order));
     }
     else {
