public function testGenerateConfirmResponseHtmlCommentOKString()
 {
     $response = WirecardCEE_QPay_ReturnFactory::generateConfirmResponseString('', true);
     $this->assertEquals('<!--<QPAY-CONFIRMATION-RESPONSE result="OK" />-->', $response);
 }
Beispiel #2
0
 public function execute()
 {
     $this->_logger->debug(__METHOD__ . ':' . print_r($this->_request->getPost()->toArray(), true));
     try {
         $return = \WirecardCEE_QPay_ReturnFactory::getInstance($this->_request->getPost()->toArray(), $this->_dataHelper->getConfigData('basicdata/secret'));
         if (!$return->validate()) {
             throw new \Exception('Validation error: invalid response');
         }
         if (!strlen($return->mage_orderId)) {
             throw new \Exception('Magento OrderId is missing');
         }
         if (!strlen($return->mage_quoteId)) {
             throw new \Exception('Magento QuoteId is missing');
         }
         $this->_orderManagement->processOrder($return);
         die(\WirecardCEE_QPay_ReturnFactory::generateConfirmResponseString());
     } catch (\Exception $e) {
         $this->_logger->debug(__METHOD__ . ':' . $e->getMessage());
         $this->_logger->debug(__METHOD__ . ':' . $e->getTraceAsString());
         die(\WirecardCEE_QPay_ReturnFactory::generateConfirmResponseString($e->getMessage()));
     }
 }