Skip to content

Commit

Permalink
remove klarnakp check
Browse files Browse the repository at this point in the history
  • Loading branch information
vegimcarkaxhija committed Jan 30, 2025
1 parent 4ef2d88 commit 8a263d2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Model/Service/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ public function cancel($order, $statusCode)
$statusCode,
$order
);
$this->logging->addDebug(__METHOD__ . '|vegiiiiiiiiiiiiiiiiiiiii|');
$this->logging->addDebug($failedStatus);

if ($failedStatus) {
$order->setStatus($failedStatus);
Expand Down
30 changes: 28 additions & 2 deletions Observer/HtmlTransactionIdObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,26 @@
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Sales\Api\Data\OrderPaymentInterface;
use Magento\Sales\Api\Data\TransactionInterface;
use Magento\Sales\Api\TransactionRepositoryInterface;
use Magento\Sales\Model\Order\Payment\Transaction;

class HtmlTransactionIdObserver implements ObserverInterface
{
/**
* @var TransactionRepositoryInterface
*/
private $transactionRepository;

/**
* Example constructor injection if you want your own logger:
* (If you already have a logger property, just reuse that.)
*/
public function __construct(
TransactionRepositoryInterface $transactionRepository
) {
$this->transactionRepository = $transactionRepository;
}
/**
* Update txn_id to a link for the plaza transaction
*
Expand All @@ -34,15 +51,24 @@ class HtmlTransactionIdObserver implements ObserverInterface
*/
public function execute(Observer $observer)
{
/** @var \Magento\Sales\Model\Order\Payment\Transaction $transaction */
/** @var Transaction $transaction */
$transaction = $observer->getDataObject();
$order = $transaction->getOrder();

$txnIdArray = explode("-", $transaction->getTxnId());
$txnId = reset($txnIdArray);

if ($this->isBuckarooPayment($order->getPayment()) && $txnId !== false) {
if($transaction->getTxnType() == 'authorization'){
$txtType = $transaction->getTxnType();
if ($transaction->getTxnType() === TransactionInterface::TYPE_VOID) {
$parentId = $transaction->getParentId();
$parentTransaction = $this->transactionRepository->get($parentId);
if ($parentTransaction) {
$txtType = $parentTransaction->getTxnType();
}
}

if($txtType == 'authorization'){
$transaction->setData('html_txn_id',
sprintf(
'<a href="https://plaza.buckaroo.nl/Transaction/DataRequest/Details/%s" target="_blank">%s</a>',
Expand Down

0 comments on commit 8a263d2

Please sign in to comment.