-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added capture and void functionality
Plugin now processes the authorized status correctly
- Loading branch information
andy
committed
Apr 1, 2019
1 parent
9cf4349
commit 284d669
Showing
45 changed files
with
643 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,20 +6,24 @@ | |
namespace Paynl\Payment\Controller\Checkout; | ||
|
||
use Magento\Checkout\Model\Session; | ||
use Magento\Framework\App\Action\Action; | ||
use Magento\Framework\App\Action\Context; | ||
use Magento\Quote\Model\QuoteRepository; | ||
use Magento\Sales\Model\Order; | ||
use Magento\Sales\Model\OrderRepository; | ||
use Paynl\Payment\Model\Config; | ||
use Psr\Log\LoggerInterface; | ||
|
||
/** | ||
* Description of Redirect | ||
* | ||
* @author Andy Pieters <[email protected]> | ||
*/ | ||
class Finish extends \Magento\Framework\App\Action\Action | ||
class Finish extends Action | ||
{ | ||
/** | ||
* | ||
* @var \Paynl\Payment\Model\Config | ||
* @var Config | ||
*/ | ||
private $config; | ||
|
||
|
@@ -29,7 +33,7 @@ class Finish extends \Magento\Framework\App\Action\Action | |
private $checkoutSession; | ||
|
||
/** | ||
* @var \Psr\Log\LoggerInterface | ||
* @var LoggerInterface | ||
*/ | ||
private $logger; | ||
|
||
|
@@ -45,17 +49,17 @@ class Finish extends \Magento\Framework\App\Action\Action | |
|
||
/** | ||
* Index constructor. | ||
* @param \Magento\Framework\App\Action\Context $context | ||
* @param \Paynl\Payment\Model\Config $config | ||
* @param Context $context | ||
* @param Config $config | ||
* @param Session $checkoutSession | ||
* @param \Psr\Log\LoggerInterface $logger | ||
* @param LoggerInterface $logger | ||
* @param OrderRepository $orderRepository | ||
*/ | ||
public function __construct( | ||
\Magento\Framework\App\Action\Context $context, | ||
\Paynl\Payment\Model\Config $config, | ||
Context $context, | ||
Config $config, | ||
Session $checkoutSession, | ||
\Psr\Log\LoggerInterface $logger, | ||
LoggerInterface $logger, | ||
OrderRepository $orderRepository, | ||
QuoteRepository $quoteRepository | ||
) | ||
|
@@ -107,7 +111,7 @@ public function execute() | |
$pinStatus = $status->getTransactionState(); | ||
} | ||
|
||
if ($transaction->isPaid() || ($transaction->isPending() && $pinStatus == null)) { | ||
if ($transaction->isPaid() || $transaction->isAuthorized() || ($transaction->isPending() && $pinStatus == null)) { | ||
$successUrl = $this->config->getSuccessPage($payment->getMethod()); | ||
$resultRedirect->setPath($successUrl, ['_query' => ['utm_nooverride' => '1']]); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.