Exemple #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();
     }
 }
Exemple #2
0
 public function getConfig($key = null, $default = null)
 {
     if (in_array($key, array('merchant_id', 'public_key', 'private_key', 'client_side_key', 'merchant_account_id'))) {
         return parent::getConfig(($this->getConfig('sandbox') ? 'test_' : '') . $key, $default);
     } else {
         return parent::getConfig($key, $default);
     }
 }