Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-1.2.3' into e2e-actions
Browse files Browse the repository at this point in the history
merge release
  • Loading branch information
Justas Vaitkus authored and Justas Vaitkus committed Aug 7, 2024
2 parents c2f4e47 + 008f558 commit a81cfcb
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 116 deletions.
18 changes: 15 additions & 3 deletions controllers/front/notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,14 @@ public function postProcess()
$secureKey
));

if (!$lockResult->isSuccessful()) {
die($this->module->l('Lock already exist', self::FILENAME));
if (!SaferPayConfig::isVersion17()) {
if ($lockResult > 200) {
die($this->module->l('Lock already exists', self::FILENAME));
}
} else {
if (!$lockResult->isSuccessful()) {
die($this->module->l('Lock already exists', self::FILENAME));
}
}

if ($cart->orderExists()) {
Expand Down Expand Up @@ -95,8 +101,8 @@ public function postProcess()
);

$checkoutData->setOrderStatus($transactionStatus);

$checkoutProcessor->run($checkoutData);

$orderId = $this->getOrderId($cartId);

//TODO look into pipeline design pattern to use when object is modified in multiple places to avoid this issue.
Expand Down Expand Up @@ -147,6 +153,12 @@ public function postProcess()
$orderId = (int) $order->id;

if ($orderId) {
$saferPayCapturedStatus = (int) Configuration::get(\Invertus\SaferPay\Config\SaferPayConfig::SAFERPAY_PAYMENT_COMPLETED);

if ((int) $order->current_state === $saferPayCapturedStatus) {
die($this->module->l('Order already created', self::FILENAME));
}

// assuming order transaction was declined
$order->setCurrentState(_SAFERPAY_PAYMENT_AUTHORIZATION_FAILED_);
}
Expand Down
4 changes: 0 additions & 4 deletions controllers/front/return.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ private function executeTransaction($orderId, $selectedCard)
);
}

private function assertTransaction($cartId) {

}

/**
* @param int $cartId
*
Expand Down
Loading

0 comments on commit a81cfcb

Please sign in to comment.