Example #1
0
 public function updateAction()
 {
     $this->form = $this->createUpdateForm();
     if ($this->form->isSubmitted() && $this->form->validate()) {
         $cc = $this->getDi()->ccRecordRecord;
         $this->form->toCcRecord($cc);
         $cc->user_id = $this->getDi()->auth->getUserId();
         $result = new Am_Paysystem_Result();
         $this->plugin->storeCreditCard($cc, $result);
         if ($result->isSuccess()) {
             return $this->redirectLocation(REL_ROOT_URL . '/member');
         } else {
             $this->form->getElementById('cc_number-0')->setError($result->getLastError());
         }
     }
     $this->view->form = $this->form;
     $this->view->invoice = null;
     $this->view->display_receipt = false;
     $this->view->display('cc/info.phtml');
 }
Example #2
0
 public function getValue()
 {
     $ret = parent::getValue();
     array_walk_recursive($ret, create_function('&$v,$k', '$v=trim($v);'));
     return $ret;
 }