} else { return \Redirect::to(Config::get('icepay-postback::error_redirect_path'))->with('OrderID', $db_order->id); } } if ($db_order->success_path && $db_order->success_path != "") { return \Redirect::to($db_order->success_path)->with('OrderID', $db_order->id); } else { return \Redirect::to(Config::get('icepay-postback::success_redirect_path'))->with('OrderID', $db_order->id); } } catch (Exception $e) { \Log::error($e->getMessage()); return \Redirect::to(Config::get('icepay-postback::error_redirect_path'))->with('message', $e->getMessage()); } }); Route::get(Config::get('icepay-postback::error_path'), function () { $error = Icepay::result(); $status = ""; //get the result and validate try { if ($error->validate()) { switch ($error->getStatus()) { case Hansvn\Icepay\StatusCode::OPEN: // Close the cart $status = "awaiting payment"; break; case Hansvn\Icepay\StatusCode::SUCCESS: // Close the cart $status = "completed"; break; case Hansvn\Icepay\StatusCode::ERROR: //Redirect to cart