Example #1
0
 public function verifyorderotpAction()
 {
     $namespace = new Zend_Session_Namespace('userInfo');
     $userMapper = new Application_Model_UsersMapper();
     $orderSession = new Zend_Session_Namespace('orderSession');
     $cartSession = new Zend_Session_Namespace('laundryCart');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout->disableLayout();
     $response = array("success" => false, "message" => "");
     $otp = $this->_getParam("otp_number");
     $key = $this->_getParam("mobile_key");
     //get otp from user
     $userOtp = $userMapper->getUserOtp($namespace->user_id);
     if (isset($orderSession->{$key}) && $orderSession->{$key} == $otp && $userOtp == $otp || $this->websiteMode == 'DEBUG') {
         $cartSession->otpVerified = true;
         $response['success'] = true;
         $response['message'] = "verified";
     } else {
         $response['message'] = "OTP is not valid";
     }
     echo Zend_Json::Encode($response);
     die;
 }