Skip to content

Commit

Permalink
PagBank 😍 Magento
Browse files Browse the repository at this point in the history
  • Loading branch information
elisei committed Feb 5, 2024
1 parent 94ad0ab commit 75b2ff7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Gateway/Response/FetchPaymentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
use Magento\Payment\Gateway\Response\HandlerInterface;
use Magento\Payment\Model\InfoInterface;
use Magento\Sales\Model\Order;
use Magento\Sales\Model\Order\Email\Sender\InvoiceSender;

/**
Expand Down Expand Up @@ -189,12 +190,15 @@ public function findForPaymentStatus($response, $charges)
public function setPaymentAuth($payment)
{
$order = $payment->getOrder();
$payment->setIsTransactionApproved(false);
$payment->setIsTransactionDenied(false);
$payment->setIsInProcess(false);
$order->setStatus('payment_review');
$comment = __('Awaiting payment review.');
$order->addStatusHistoryComment($comment, $payment->getOrder()->getStatus());

if ($order->getState() !== Order::STATE_PAYMENT_REVIEW) {
$payment->setIsTransactionApproved(false);
$payment->setIsTransactionDenied(false);
$payment->setIsInProcess(false);
$order->setStatus('payment_review');
$comment = __('Awaiting payment review.');
$order->addStatusHistoryComment($comment, $payment->getOrder()->getStatus());
}
}

/**
Expand Down

0 comments on commit 75b2ff7

Please sign in to comment.