/** * @throws \Exception */ public function setLogoAction() { if (RequestHelper::isPost($this->getRequest())) { var_dump($_FILES); die; $files = $this->getRequest()->getFiles(); var_dump($files); die; } }
/** * @return JsonModel */ public function itemsAction() { $user = $this->zfcUserAuthentication()->getIdentity(); if (UserHelper::isMerchant($user) && RequestHelper::isPost($this->getRequest())) { $campaignId = $this->getRequest()->getPost()->get('campaignId'); $campaignService = $this->getServiceLocator()->get('campaignService'); return new JsonModel(ItemFacace::formatItemCollection($campaignService->getBuyXRewards($campaignId))); } }
/** * @return JsonModel */ public function editAction() { $user = $this->zfcUserAuthentication()->getIdentity(); if (UserHelper::isMerchant($user) && RequestHelper::isPost($this->getRequest())) { $customer = new Customer(); $customFields = $this->getServiceLocator()->get('customerService')->getCustomFields($user->getAccount()); $customer->fillFromPost($this->getRequest()->getPost(), $customFields); $customerService = $this->getServiceLocator()->get('customerService'); $customerService->editCustomer($customer, $user->getAccount()); return new JsonModel(array('message' => "Customer updated successfully")); } }
/** * @return JsonModel * @throws \Exception */ public function addPointsAction() { $user = $this->zfcUserAuthentication()->getIdentity(); if (UserHelper::isMerchant($user) && RequestHelper::isPost($this->getRequest())) { $customerCode = $this->getRequest()->getPost()->get('customerCode'); $campaignId = $this->getRequest()->getPost()->get('campaignId'); $amount = $this->getRequest()->getPost()->get('amount'); $promoId = $this->getRequest()->getPost()->get('promoId'); $authorization = $this->getRequest()->getPost()->get('authorization'); $transactionAdapter = $this->getServiceLocator()->get('transactionAdapter'); $transactionAdapter->setUser($user); if ($transactionAdapter->manuallyAddPoint($customerCode, $campaignId, $amount, $authorization, $promoId)) { return new JsonModel(array('message' => 'Transaction successfully done')); } } }