Skip to content

Commit

Permalink
Merge pull request #183 from Invertus/SL-247/order-states-fix
Browse files Browse the repository at this point in the history
SL-247/ check order captured state on failure if multiple statuses comes at once
  • Loading branch information
GytisZum authored Aug 1, 2024
2 parents 867ec7c + ab06e19 commit 9c9e747
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers/front/notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,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

0 comments on commit 9c9e747

Please sign in to comment.