Beispiel #1
0
 /**
  * Process the validated form and if ok, display thanks page,
  * if not ok, return false
  */
 public function processCc()
 {
     $cc = $this->getDi()->ccRecordRecord;
     $this->form->toCcRecord($cc);
     $cc->user_id = $this->invoice->user_id;
     if ($this->plugin->getConfig('use_maxmind')) {
         $checkresult = $this->plugin->doMaxmindCheck($this->invoice, $cc);
         if (!$checkresult->isSuccess()) {
             $this->view->error = $checkresult->getErrorMessages();
             return;
         }
     }
     $result = $this->plugin->doBill($this->invoice, true, $cc);
     if ($result->isSuccess()) {
         if ($this->invoice->rebill_times > 0 && !$cc->pk()) {
             $this->plugin->storeCreditCard($cc, new Am_Paysystem_Result());
         }
         $this->redirectLocation($this->plugin->getReturnUrl());
         return true;
     } elseif ($result->isAction() && $result->getAction() instanceof Am_Paysystem_Action_Redirect) {
         $result->getAction()->process($this);
         // throws Am_Exception_Redirect (!)
     } else {
         $this->view->error = $result->getErrorMessages();
     }
 }
 /**
  * Process the validated form and if ok, display thanks page,
  * if not ok, return false
  */
 public function processCc()
 {
     $cc = $this->getDi()->ccRecordRecord;
     $this->form->toCcRecord($cc);
     $cc->user_id = $this->invoice->user_id;
     $result = $this->plugin->doBill($this->invoice, true, $cc);
     if ($result->isSuccess()) {
         if ($this->invoice->rebill_times > 0 && !$cc->pk()) {
             $this->plugin->storeCreditCard($cc, new Am_Paysystem_Result());
         }
         $this->redirectLocation($this->plugin->getReturnUrl());
         return true;
     } else {
         $this->view->error = $result->getErrorMessages();
     }
 }