Example #1
0
 /**
  * Public method called after the customer returns to the shop
  *
  * @param string $status
  * @param string $reason
  * @param string $transactionId
  */
 public function createOrderAfterRedirect($status, $reason, $transactionId)
 {
     // workaround for missing session after creating order
     $orderVariables = unserialize(Shopware()->Session()->offsetGet('sofortMailVariables'));
     $user = $this->context->getUser();
     $alreadySend = false;
     $result = false;
     if (!Shopware()->Session()->sofortOrderExsist) {
         Shopware()->Session()->sofortSendMail = true;
         //create Order
         $result = $this->saveOrder($transactionId, 0);
         $alreadySend = true;
     } else {
         $helper = new Shopware_Plugins_Frontend_SofortPayment_Components_Helpers_Helper();
         $helper->database()->changeTransactionId($this->context->getOrderNumber(), $transactionId);
         $this->setOrderState($transactionId, 0);
     }
     $state = $this->context->convertLibState($status, $reason);
     if ($state !== 0) {
         $row = $this->getOrderInformation($transactionId);
         $order = Shopware()->Modules()->Order();
         $order->setPaymentStatus($row['id'], $state, false);
         $this->logger->logManually(__CLASS__, 'Change PaymentStatus for Order #' . $row['ordernumber'] . '(' . $row['id'] . ') to ' . $state);
     }
     if (!$alreadySend) {
         //send Mail
         $this->sendMail($orderVariables, $user);
     }
 }
	public function __construct(Enlight_Controller_Request_Request $request, Enlight_Controller_Response_Response $response) {
		$this->config = Shopware()->Plugins()->Frontend()->BuiswPaymentPayone()->Config();
        
		$this->errorurl = $this->Front()->Router()->assemble(array(
				'action' => 'payment',
				'sTarget' => 'checkout',
				'sViewport' => 'account',
				'appendSession' => true,
				'forceSecure' => true
						));

		parent::__construct($request, $response);
	}
Example #3
0
 public function __construct(\Enlight_Controller_Request_Request $request, \Enlight_Controller_Response_Response $response)
 {
     $this->orderProcessHelper = new Shopware_Plugins_Frontend_SofortPayment_Components_Helpers_OrderProcessHelper($this);
     parent::__construct($request, $response);
 }