Beispiel #1
0
 public function paysofortAction()
 {
     $this->setSmartyOutput(false);
     $arrUserRequest = $this->getUserRequest();
     // no invoice id given
     if (false == isset($arrUserRequest['params']['0']) || false == is_numeric($arrUserRequest['params']['0'])) {
         $this->redirectTo('invoice');
         return;
     }
     // sofortu is disabled
     if (false == SOFORTU_ENABLE) {
         $this->setMessage('Die Bezahlung über sofortüberweisung.de ist momentan nicht möglich', 'error');
         $this->redirectTo('invoice', 'pay', $arrUserRequest['params']['0']);
         return;
     }
     $objDataInvoice = new GSALES_DATA_INVOICE();
     $objInvoice = $objDataInvoice->getInvoiceById($arrUserRequest['params']['0'], $this->objUserAuth->getCustomerId(), true);
     // invoice does not exist (or belongs to another customer)
     if (false == $objInvoice) {
         $this->redirectTo('invoice');
         return;
     }
     // do sofortüberweisung
     require_once FE_DIR . '/lib/payment/sofortueberweisung.php';
     $objSofort = new SOFORTUEBERWEISUNG();
     $objSofort->setAmount($objInvoice->getOpenAmount());
     $objSofort->setInvoiceId($objInvoice->getId());
     $objSofort->setReason1('SU RNR ' . $objInvoice->getInvoiceNo());
     $objSofort->setReason2('VOM ' . date("d.m.Y", strtotime($objInvoice->getCreated())));
     $objSofort->startProcess();
 }
Beispiel #2
0
 public function sofortpnAction()
 {
     if (isset($_POST)) {
         $this->setSmartyOutput(false);
         require_once FE_DIR . '/lib/payment/sofortueberweisung.php';
         $objSofort = new SOFORTUEBERWEISUNG();
         $objPayment = $objSofort->checkAndvalidatePN();
         if (false == $objPayment) {
             return false;
         }
     } else {
         $this->redirectTo('index', 'index');
     }
 }