Skip to content

Commit

Permalink
UNZER-275 fix codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriivolkhinoxid committed Nov 16, 2023
1 parent f4960d8 commit 6d2af54
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 30 deletions.
6 changes: 3 additions & 3 deletions src/Controller/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function unzerExecuteAfterRedirect(): void
{
// get basket contents
$oUser = $this->getUser();
$oBasket = $this->getSession()->getBasket();
$oBasket = Registry::getSession()->getBasket();
if ($oBasket->getProductsCount()) {
$oDB = DatabaseProvider::getDb();

Expand All @@ -114,7 +114,7 @@ public function unzerExecuteAfterRedirect(): void
// performing special actions after user finishes order (assignment to special user groups)
$oUser->onOrderExecute($oBasket, $iSuccess);

$nextStep = $this->_getNextStep($iSuccess);
$nextStep = $this->getNextStep($iSuccess);

$unzerService = $this->getServiceFromContainer(Unzer::class);

Expand Down Expand Up @@ -263,7 +263,7 @@ public function executeoscunzer(): ?string
return null;
}

if (!$this->_validateTermsAndConditions()) {
if (!$this->validateTermsAndConditions()) {
$this->_blConfirmAGBError = true;
return null;
}
Expand Down
3 changes: 0 additions & 3 deletions src/Controller/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
use OxidEsales\Eshop\Application\Model\Order;
use OxidSolutionCatalysts\Unzer\Core\UnzerDefinitions as CoreUnzerDefinitions;
use OxidSolutionCatalysts\Unzer\Service\UserRepository;
use OxidSolutionCatalysts\Unzer\Core\UnzerDefinitions as CoreUnzerDefinitions;
use OxidSolutionCatalysts\Unzer\Service\UnzerDefinitions;
use OxidSolutionCatalysts\Unzer\Service\ModuleSettings;
use OxidSolutionCatalysts\Unzer\Traits\ServiceContainer;
use OxidEsales\Eshop\Application\Model\Payment;
use OxidEsales\Eshop\Application\Controller\PaymentController as PaymentController_parent;
use OxidEsales\Eshop\Core\Registry;

class PaymentController extends PaymentController_parent
Expand Down
36 changes: 12 additions & 24 deletions src/Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

use Exception;
use OxidEsales\Eshop\Application\Model\Basket;
use OxidEsales\Eshop\Application\Model\Order as Order_parent;
use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Field;
use OxidEsales\Eshop\Core\Registry;
Expand Down Expand Up @@ -57,21 +56,21 @@ public function finalizeUnzerOrderAfterRedirect(

if ($unzerPaymentStatus !== "ERROR") {
// copies user info
$this->_setUser($oUser);
$this->setUser($oUser);

// copies basket info
$this->_loadFromBasket($oBasket);
$this->loadFromBasket($oBasket);

$oUserPayment = $this->_setPayment($oBasket->getPaymentId());
$oUserPayment = $this->setPayment($oBasket->getPaymentId());

// set folder information, order is new
$this->_setFolder();
$this->setFolder();

//saving all order data to DB
$this->save();

if (!$this->getFieldData('oxordernr')) {
$this->_setNumber();
$this->setNumber();
}

// setUnzerOrderId
Expand All @@ -82,27 +81,27 @@ public function finalizeUnzerOrderAfterRedirect(
Registry::getSession()->deleteVariable('ordrem');

//#4005: Order creation time is not updated when order processing is complete
$this->_updateOrderDate();
$this->updateOrderDate();

// store orderid
$oBasket->setOrderId($orderId);

// updating wish lists
$this->_updateWishlist($oBasket->getContents(), $oUser);
$this->updateWishlist($oBasket->getContents(), $oUser);

// updating users notice list
$this->_updateNoticeList($oBasket->getContents(), $oUser);
$this->updateNoticeList($oBasket->getContents(), $oUser);

// marking vouchers as used and sets them to $this->_aVoucherList (will be used in order email)
$this->_markVouchers($oBasket, $oUser);
$this->markVouchers($oBasket, $oUser);

// send order by email to shop owner and current user
// don't let order fail due to stock check while sending out the order mail
Registry::getSession()->setVariable('blDontCheckProductStockForUnzerMails', true);
$iRet = $this->_sendOrderByEmail($oUser, $oBasket, $oUserPayment);
$iRet = $this->sendOrderByEmail($oUser, $oBasket, $oUserPayment);
Registry::getSession()->deleteVariable('blDontCheckProductStockForUnzerMails');

$this->_setOrderStatus($unzerPaymentStatus);
$this->setOrderStatus($unzerPaymentStatus);

if ($unzerPaymentStatus === 'OK') {
$this->markUnzerOrderAsPaid();
Expand Down Expand Up @@ -172,7 +171,7 @@ public function markUnzerOrderAsPaid(): void
}
// e.g. prepayments start with "NO_FINISHED", if they are marked as paid,
// we set the status to OK here
$this->_setOrderStatus('OK');
$this->setOrderStatus('OK');
}

/**
Expand Down Expand Up @@ -244,15 +243,4 @@ public function delete($sOxId = null)

return parent::delete($sOxId);
}

/**
* @param string $fieldName
* @param string $value
* @param int $dataType
* @return false|void
*/
public function setFieldData($fieldName, $value, $dataType = Field::T_TEXT)
{
return parent::_setFieldData($fieldName, $value, $dataType);
}
}

0 comments on commit 6d2af54

Please sign in to comment.