示例#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');
 }
示例#2
0
 public function validate()
 {
     return parent::validate() && $this->plugin->onFormValidate($this);
 }