Пример #1
0
 public function getPayment($planID, $token)
 {
     $serviceResponse = new ServiceResponse();
     $user = $this->GetSessionUser($token);
     if ($user->IsSuccess) {
         $userDetail = UserEntity::where('UserID', $user->Data->UserID)->first();
         if ($userDetail->IsVerified) {
             $serviceResponse = $this->DataProvider->PaymentDetails($planID);
             if ($serviceResponse->IsSuccess) {
                 $amount = $serviceResponse->Data->PaidAmount;
                 $data = array('amount' => $amount, 'fullname' => $user->Data->FirstName . ' ' . $user->Data->LastName, 'email' => $user->Data->Email, 'mobile' => $user->Data->Mobile, 'productInfo' => 'This is the product info', 'planID' => $planID, 'userID' => $user->Data->UserID);
                 return View::make('payment.detail')->with($data);
             }
         } else {
             $serviceResponse->IsSuccess = true;
             $serviceResponse->Data = $userDetail;
             $serviceResponse->ErrorCode = Constants::$MobileNotVerified;
             $serviceResponse->Message = trans("messages.MobileNotEnabled");
         }
     } else {
         $serviceResponse = $user;
         return $this->GetJsonResponse($serviceResponse);
     }
 }