Skip to content

Commit

Permalink
Merge pull request #204 from BoulangerV/OXID-337-Statusaenderung_bei_…
Browse files Browse the repository at this point in the history
…Eintreffen_eines_nachgelagerten_Appointed_Status

OXID-337 : handles appointed txstatus for 'error' orders
  • Loading branch information
hreinberger authored Feb 5, 2021
2 parents ce22b74 + 0f77d0a commit 3608f5a
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions status.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ public function handle()
$this->_isKeyValid();
$sStatusmessageId = $this->log();
$this->_allowDebit();
$this->_handleAppointed();
$this->_handlePaid();
$this->_handleMapping();
$this->_handleForwarding($sStatusmessageId);
Expand Down Expand Up @@ -384,6 +385,46 @@ protected function _getOrder($sTxid=null) {

}

/**
* OXID-337
* Check if appointed signal has been posted and handles it
*
* @param void
* @return void
* @throws Exception
*/
protected function _handleAppointed()
{
if ($this->fcGetPostParam('txaction') != 'appointed') {
return;
}

try {
$oOrder = $this->_getOrder();
$sOrderId = $oOrder->getId();
$oLang = oxNew('oxLang');

$sReplacement = $oLang->translateString('FCPO_REMARK_APPOINTED_MISSING');

$sQuery = "
UPDATE
oxorder
SET
oxfolder = 'ORDERFOLDER_NEW',
oxtransstatus = 'OK',
oxremark = REPLACE(oxremark, '".$sReplacement."', '')
WHERE
oxid = '{$sOrderId}' AND
oxtransstatus IN ('ERROR') AND
oxfolder = 'ORDERFOLDER_PROBLEMS'
";

oxDb::getDb()->Execute($sQuery);
} catch (Exception $e) {
throw $e;
}
}

/**
* Check if paid signal has been posted and handle it
*
Expand Down

0 comments on commit 3608f5a

Please sign in to comment.