Skip to content

Commit 0be8af7

Browse files
Release version 4.0.0
1 parent fc42986 commit 0be8af7

File tree

83 files changed

+272
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+272
-231
lines changed

Block/Adminhtml/System/Config/Fieldset/Payment.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44

55
class Payment extends \Magento\Config\Block\System\Config\Form\Fieldset
66
{
7-
private \Magento\Payment\Model\MethodInterface $afterpay;
8-
private \Afterpay\Afterpay\Model\Config $config;
7+
private $afterpay;
8+
private $config;
99

1010
public function __construct(
1111
\Magento\Backend\Block\Context $context,
1212
\Magento\Backend\Model\Auth\Session $authSession,
1313
\Magento\Framework\View\Helper\Js $jsHelper,
14-
\Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer,
1514
\Magento\Payment\Model\MethodInterface $afterpay,
1615
\Afterpay\Afterpay\Model\Config $config,
1716
array $data = []
1817
) {
19-
parent::__construct($context, $authSession, $jsHelper, $data, $secureRenderer);
18+
parent::__construct($context, $authSession, $jsHelper, $data);
2019
$this->afterpay = $afterpay;
2120
$this->config = $config;
2221
}

Block/Adminhtml/System/Config/Form/Field/Version.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,19 @@
55
namespace Afterpay\Afterpay\Block\Adminhtml\System\Config\Form\Field;
66

77
use Magento\Backend\Block\Template\Context;
8-
use Magento\Framework\View\Helper\SecureHtmlRenderer;
98

109
class Version extends \Magento\Config\Block\System\Config\Form\Field
1110
{
1211
const MODULE_NAME = "Afterpay_Afterpay";
1312

14-
private \Magento\Framework\Module\ResourceInterface $resource;
13+
private $resource;
1514

1615
public function __construct(
1716
\Magento\Framework\Module\ResourceInterface $resource,
1817
Context $context,
19-
array $data = [],
20-
?SecureHtmlRenderer $secureRenderer = null
18+
array $data = []
2119
) {
22-
parent::__construct($context, $data, $secureRenderer);
20+
parent::__construct($context, $data);
2321
$this->resource = $resource;
2422
}
2523

Controller/Adminhtml/MerchantConfiguration/Update.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
class Update implements \Magento\Framework\App\Action\HttpPostActionInterface
66
{
7-
private \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory;
8-
private \Magento\Framework\Message\ManagerInterface $messageManager;
9-
private \Magento\Framework\App\RequestInterface $request;
10-
private \Magento\Payment\Gateway\CommandInterface $merchantConfigurationCommand;
7+
private $resultJsonFactory;
8+
private $messageManager;
9+
private $request;
10+
private $merchantConfigurationCommand;
1111

1212
public function __construct(
1313
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,

Controller/Express/CreateCheckout.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
class CreateCheckout implements \Magento\Framework\App\Action\HttpPostActionInterface
88
{
9-
private \Afterpay\Afterpay\Api\CheckoutManagementInterface $checkoutManagement;
10-
private \Magento\Checkout\Model\Session $checkoutSession;
11-
private \Magento\Framework\UrlInterface $url;
12-
private \Magento\Framework\Controller\Result\JsonFactory $jsonResultFactory;
13-
private \Magento\Framework\Message\ManagerInterface $messageManager;
14-
private \Psr\Log\LoggerInterface $logger;
9+
private $checkoutManagement;
10+
private $checkoutSession;
11+
private $url;
12+
private $jsonResultFactory;
13+
private $messageManager;
14+
private $logger;
1515

1616
public function __construct(
1717
\Afterpay\Afterpay\Api\CheckoutManagementInterface $checkoutManagement,

Controller/Express/GetShippingOptions.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
class GetShippingOptions implements \Magento\Framework\App\Action\HttpPostActionInterface
66
{
7-
private \Magento\Checkout\Model\Session $checkoutSession;
8-
private \Magento\Framework\Controller\Result\JsonFactory $jsonResultFactory;
9-
private \Magento\Framework\App\RequestInterface $request;
10-
private \Afterpay\Afterpay\Model\Shipment\Express\ShippingListProvider $shippingListProvider;
11-
private \Afterpay\Afterpay\Model\Shipment\Express\ShippingAddressUpdater $shippingAddressUpdater;
12-
private \Psr\Log\LoggerInterface $logger;
13-
private \Magento\Framework\Message\ManagerInterface $messageManager;
7+
private $checkoutSession;
8+
private $jsonResultFactory;
9+
private $request;
10+
private $shippingListProvider;
11+
private $shippingAddressUpdater;
12+
private $logger;
13+
private $messageManager;
1414

1515
public function __construct(
1616
\Magento\Framework\App\RequestInterface $request,

Controller/Express/PlaceOrder.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ class PlaceOrder implements \Magento\Framework\App\Action\HttpPostActionInterfac
66
{
77
const CANCELLED_STATUS = 'CANCELLED';
88

9-
private \Magento\Framework\App\RequestInterface $request;
10-
private \Magento\Framework\Message\ManagerInterface $messageManager;
11-
private \Magento\Checkout\Model\Session $checkoutSession;
12-
private \Magento\Framework\Controller\Result\JsonFactory $jsonFactory;
13-
private \Magento\Framework\UrlInterface $url;
14-
private \Afterpay\Afterpay\Model\Payment\Capture\PlaceOrderProcessor $placeOrderProcessor;
15-
private \Magento\Payment\Gateway\CommandInterface $syncCheckoutDataCommand;
9+
private $request;
10+
private $messageManager;
11+
private $checkoutSession;
12+
private $jsonFactory;
13+
private $url;
14+
private $placeOrderProcessor;
15+
private $syncCheckoutDataCommand;
1616

1717
public function __construct(
1818
\Magento\Framework\App\RequestInterface $request,

Controller/Payment/Capture.php

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,30 @@ class Capture implements \Magento\Framework\App\Action\HttpGetActionInterface
77
const CHECKOUT_STATUS_CANCELLED = 'CANCELLED';
88
const CHECKOUT_STATUS_SUCCESS = 'SUCCESS';
99

10-
private \Magento\Framework\App\RequestInterface $request;
11-
private \Magento\Checkout\Model\Session $session;
12-
private \Magento\Framework\Controller\Result\RedirectFactory $redirectFactory;
13-
private \Magento\Framework\Message\ManagerInterface $messageManager;
14-
private \Afterpay\Afterpay\Model\Payment\Capture\PlaceOrderProcessor $placeOrderProcessor;
15-
private \Magento\Payment\Gateway\CommandInterface $validateCheckoutDataCommand;
10+
private $request;
11+
private $session;
12+
private $redirectFactory;
13+
private $messageManager;
14+
private $placeOrderProcessor;
15+
private $validateCheckoutDataCommand;
16+
private $storeManager;
1617

1718
public function __construct(
1819
\Magento\Framework\App\RequestInterface $request,
1920
\Magento\Checkout\Model\Session $session,
2021
\Magento\Framework\Controller\Result\RedirectFactory $redirectFactory,
2122
\Magento\Framework\Message\ManagerInterface $messageManager,
2223
\Afterpay\Afterpay\Model\Payment\Capture\PlaceOrderProcessor $placeOrderProcessor,
23-
\Magento\Payment\Gateway\CommandInterface $validateCheckoutDataCommand
24+
\Magento\Payment\Gateway\CommandInterface $validateCheckoutDataCommand,
25+
\Magento\Store\Model\StoreManagerInterface $storeManager
2426
) {
2527
$this->request = $request;
2628
$this->session = $session;
2729
$this->redirectFactory = $redirectFactory;
2830
$this->messageManager = $messageManager;
2931
$this->placeOrderProcessor = $placeOrderProcessor;
3032
$this->validateCheckoutDataCommand = $validateCheckoutDataCommand;
33+
$this->storeManager = $storeManager;
3134
}
3235

3336
public function execute()
@@ -36,13 +39,17 @@ public function execute()
3639
$this->messageManager->addErrorMessage(
3740
(string)__('You have cancelled your Afterpay payment. Please select an alternative payment method.')
3841
);
39-
return $this->redirectFactory->create()->setPath('checkout/cart');
42+
return $this->redirectFactory->create()->setPath('checkout/cart', [
43+
'_scope' => $this->storeManager->getStore()
44+
]);
4045
}
4146
if ($this->request->getParam('status') != self::CHECKOUT_STATUS_SUCCESS) {
4247
$this->messageManager->addErrorMessage(
4348
(string)__('Afterpay payment is failed. Please select an alternative payment method.')
4449
);
45-
return $this->redirectFactory->create()->setPath('checkout/cart');
50+
return $this->redirectFactory->create()->setPath('checkout/cart', [
51+
'_scope' => $this->storeManager->getStore()
52+
]);
4653
}
4754

4855
try {
@@ -54,7 +61,9 @@ public function execute()
5461
? $e->getMessage()
5562
: (string)__('Payment is failed');
5663
$this->messageManager->addErrorMessage($errorMessage);
57-
return $this->redirectFactory->create()->setPath('checkout/cart');
64+
return $this->redirectFactory->create()->setPath('checkout/cart', [
65+
'_scope' => $this->storeManager->getStore()
66+
]);
5867
}
5968

6069
$this->messageManager->addSuccessMessage((string)__('Afterpay Transaction Completed'));

Cron/MerchantConfigurationUpdater.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
class MerchantConfigurationUpdater
88
{
9-
private \Magento\Payment\Gateway\CommandInterface $merchantConfigurationCommand;
10-
private \Magento\Store\Model\StoreManagerInterface $storeManager;
11-
private \Afterpay\Afterpay\Model\Config $config;
12-
private \Psr\Log\LoggerInterface $logger;
13-
private \Magento\Framework\App\Cache\TypeListInterface $typeList;
9+
private $merchantConfigurationCommand;
10+
private $storeManager;
11+
private $config;
12+
private $logger;
13+
private $typeList;
1414

1515
public function __construct(
1616
\Magento\Payment\Gateway\CommandInterface $merchantConfigurationCommand,

Cron/OfflineCreditMemo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class OfflineCreditMemo
66
{
7-
private \Afterpay\Afterpay\Model\Order\CreditMemo\StatusChanger $statusChanger;
7+
private $statusChanger;
88

99
public function __construct(
1010
\Afterpay\Afterpay\Model\Order\CreditMemo\StatusChanger $statusChanger

Gateway/Command/CommandPoolProxy.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
class CommandPoolProxy implements \Magento\Payment\Gateway\Command\CommandPoolInterface
66
{
7-
protected ?\Magento\Payment\Gateway\Command\CommandPoolInterface $commandPool = null;
7+
protected $commandPool = null;
88

9-
private \Magento\Payment\Gateway\Command\CommandPoolFactory $commandPoolFactory;
10-
private \Afterpay\Afterpay\Model\Config $config;
11-
private array $commands;
9+
private $commandPoolFactory;
10+
private $config;
11+
private $commands;
1212

1313
public function __construct(
1414
\Magento\Payment\Gateway\Command\CommandPoolFactory $commandPoolFactory,

0 commit comments

Comments
 (0)