Skip to content

Commit

Permalink
Merge pull request #25 from AdelanteFinancialHoldings/fix/channels/ma…
Browse files Browse the repository at this point in the history
…gento/fix-custom-status-order

Added condition in the AddiGelper.php class to only return the custom…
  • Loading branch information
alexcol23 committed Sep 29, 2023
2 parents 975249d + e37a004 commit 4896a40
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions Controller/Callback/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ protected function processApproved(Order $order, $params)
$status = $this->_addiHelper->getNewOrderStatus();
$order->setStatus($status);
$order->setState("processing");
$this->logger("ADDI UPDATED ORDER STATUS for Order ID " . $params->orderId . ": " . $status);

$order->save();
} catch (Exception $e) {
Expand Down
6 changes: 5 additions & 1 deletion Helper/AddiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class AddiHelper extends AbstractHelper
{
CONST WIDGET_VERSION_01 = 'ADDI_TEMPLATE_01';
CONST WIDGET_VERSION_02 = 'ADDI_TEMPLATE_02';
CONST STATUS_POR_SINCRONIZAR = 'por_sincronizar';
CONST STATUS_PROCESSING = 'processing';


/** @var Image */
protected $_imageHelper;
Expand Down Expand Up @@ -87,7 +90,8 @@ public function getCheckoutTemplate($country, $version)

public function getNewOrderStatus()
{
return $this->scopeConfig->getValue("payment/addi/credentials/order_status", ScopeInterface::SCOPE_STORE);
$status = $this->scopeConfig->getValue("payment/addi/credentials/order_status", ScopeInterface::SCOPE_STORE);
return $status === self::STATUS_POR_SINCRONIZAR ? $status : self::STATUS_PROCESSING;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Magento 2 Payment Module",
"type": "magento2-module",
"license": "proprietary",
"version": "1.0.17",
"version": "1.0.18",
"minimum-stability": "stable",
"prefer-stable": true,
"autoload": {
Expand Down

0 comments on commit 4896a40

Please sign in to comment.