public function postRecharge() { try { $voucher_type = Input::get('voucher_type', NULL); $pin = Input::get('pin', NULL); if ($voucher_type == NULL) { throw new Exception("Select Voucher Type."); } if ($pin == NULL) { throw new Exception("Please enter a valid PIN"); } switch ($voucher_type) { case 'prepaid': Recharge::viaPin($pin, Auth::id()); $this->notifySuccess('Recharge Successful.'); break; case 'refill': Refillcoupons::viaPin($pin, Auth::id()); $this->notifySuccess('Refill Applied.'); break; } return Redirect::route(self::HOME); } catch (Exception $e) { $this->notifyError($e->getMessage()); return Redirect::back(); } }
public function postRefill() { try { $pin = Input::get('pin', NULL); Refillcoupons::viaPin($pin, Auth::id()); $this->notifySuccess('Refill Successful.'); return Redirect::route(self::HOME); } catch (Exception $e) { $this->notifyError($e->getMessage()); return Redirect::back(); } }
public function postRecharge() { try { if (Refillcoupons::viaPin(Input::get('pin'), Input::get('user_id'))) { $this->notifySuccess('Refill Successful.'); } else { $this->notifyError('Refill Failed.'); } } catch (Exception $e) { $this->notifyError($e->getMessage()); return Redirect::back(); } return Redirect::back(); }