diff --git a/modules/wirecard/checkoutseamless/controllers/wirecardcheckoutseamlessorder.php b/modules/wirecard/checkoutseamless/controllers/wirecardcheckoutseamlessorder.php index 1356420..e302fba 100644 --- a/modules/wirecard/checkoutseamless/controllers/wirecardcheckoutseamlessorder.php +++ b/modules/wirecard/checkoutseamless/controllers/wirecardcheckoutseamlessorder.php @@ -92,8 +92,14 @@ protected function _getNextStep($iSuccess) $aFormattedErrors[] = $error->getConsumerMessage(); } - if($config->getDeleteFailedOrCanceledOrders()) + if($config->getDeleteFailedOrCanceledOrders()) { $oOrder->delete(); + } + else { + $oOrder->cancelOrder(); + $oOrder->oxorder__oxtransstatus = new oxField('FAILED'); + $oOrder->save(); + } wirecardCheckoutSeamlessUtils::getInstance()->log(__METHOD__ . ':ERROR:' . print_r($aFormattedErrors, true)); return parent::_getNextStep(implode("
\n", $aFormattedErrors)); @@ -304,27 +310,33 @@ public function wirecardConfirm() case WirecardCEE_QMore_ReturnFactory::STATE_CANCEL: /** @var $return WirecardCEE_QMore_Return_Cancel */ wirecardCheckoutSeamlessUtils::getInstance()->log(__METHOD__ . ':CANCEL'); - $oOrder->oxorder__oxtransstatus = new oxField('CANCELED'); - $oOrder->cancelOrder(); - $oOrder->save(); $oDbOrder->delete($aOrderData['OXID']); - if($config->getDeleteFailedOrCanceledOrders()) + if($config->getDeleteFailedOrCanceledOrders()) { $oOrder->delete(); + } + else { + $oOrder->cancelOrder(); + $oOrder->oxorder__oxtransstatus = new oxField('CANCELED'); + $oOrder->save(); + } break; case WirecardCEE_QMore_ReturnFactory::STATE_FAILURE: /** @var $return WirecardCEE_QMore_Return_Failure */ wirecardCheckoutSeamlessUtils::getInstance()->log(__METHOD__ . ':FAILURE:' . print_r($return->getErrors(), true)); - $oOrder->oxorder__oxtransstatus = new oxField('FAILED'); - $oOrder->cancelOrder(); - $oOrder->save(); $oDbOrder->delete($aOrderData['OXID']); - if($config->getDeleteFailedOrCanceledOrders()) + if($config->getDeleteFailedOrCanceledOrders()) { $oOrder->delete(); + } + else { + $oOrder->cancelOrder(); + $oOrder->oxorder__oxtransstatus = new oxField('CANCELED'); + $oOrder->save(); + } $consumerMessage = ''; /** var $e WirecardCEE_QMore_Error */ @@ -347,7 +359,6 @@ public function wirecardConfirm() die; } - /** * Returns current order object * diff --git a/modules/wirecard/checkoutseamless/controllers/wirecardcheckoutseamlesspayment.php b/modules/wirecard/checkoutseamless/controllers/wirecardcheckoutseamlesspayment.php index b433ff3..ac8b381 100644 --- a/modules/wirecard/checkoutseamless/controllers/wirecardcheckoutseamlesspayment.php +++ b/modules/wirecard/checkoutseamless/controllers/wirecardcheckoutseamlesspayment.php @@ -660,6 +660,8 @@ public function getWcsPaymentError() if (oxRegistry::getSession()->hasVariable('wcs_payerrortext')) { $wcs_payment_error = oxRegistry::getSession()->getVariable('wcs_payerrortext'); oxRegistry::getSession()->deleteVariable('wcs_payerrortext'); + oxRegistry::getSession()->deleteVariable('sess_challenge'); + oxRegistry::getSession()->deleteVariable('wcpPaymentState'); } return $wcs_payment_error;