Skip to content

Commit

Permalink
Release version 3.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
afterpayplugins committed Sep 8, 2021
1 parent e16ca5b commit 475d026
Show file tree
Hide file tree
Showing 80 changed files with 270 additions and 198 deletions.
2 changes: 1 addition & 1 deletion Block/Adminhtml/System/Config/Button/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay Payment
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Block\Adminhtml\System\Config\Button;

Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/System/Config/Form/Field/Disable.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay Payment
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Block\Adminhtml\System\Config\Form\Field;

Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/System/Config/Form/Field/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay Payment
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Block\Adminhtml\System\Config\Form\Field;

Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/System/Config/Form/Field/cbtLabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay Payment
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Block\Adminhtml\System\Config\Form\Field;

Expand Down
8 changes: 8 additions & 0 deletions Block/Catalog/Installments.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ public function getTypeOfProduct()
return $product->getTypeId();
}

/**
* @return \Magento\Catalog\Model\Product|null
*/
public function getProduct()
{
return $this->registry->registry('product');
}

/**
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion Block/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay Payment
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Block;

Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Afterpay Magento 2 Extension Changelog

## Version 3.4.3

_Wed 08 Sep 2021_

### Supported Editions & Versions

Tested and verified in clean installations of Magento 2:

- Magento Community Edition (CE) version 2.4.3
- Magento Enterprise Edition (EE) version 2.4.2

### Highlights

- Disabled Express Checkout for virtual products.
- Improved the asset cache handling.
- Improved customer email address validation to allow symbols such as “+”.
- Improved debug logging.

---
## Version 3.4.2

_Wed 16 June 2021_
Expand Down
81 changes: 25 additions & 56 deletions Controller/Payment/Express.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Controller\Payment;

Expand Down Expand Up @@ -63,50 +63,53 @@ class Express extends \Magento\Framework\App\Action\Action

protected $_timezone;


private \Afterpay\Afterpay\Model\ExpressPayment\ShippingListProvider $shippingListProvider;

/**
* Response constructor.
*
* @param \Magento\Framework\App\Action\Context $context
* @param \Magento\Checkout\Model\Session $checkoutSession
*/
public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Framework\App\Action\Context $context,
\Magento\Framework\ObjectManagerInterface $objectManager,
CheckoutSession $checkoutSession,
QuoteFactory $quoteFactory,
AfterpayConfig $afterpayConfig,
AfterpayOrderTokenV2 $afterpayOrderTokenV2,
TokenCheck $tokenCheck,
JsonHelper $jsonHelper,
Helper $helper,
QuoteRepository $quoteRepository,
JsonResultFactory $jsonResultFactory,
QuoteValidator $quoteValidator,
CheckoutSession $checkoutSession,
QuoteFactory $quoteFactory,
AfterpayConfig $afterpayConfig,
AfterpayOrderTokenV2 $afterpayOrderTokenV2,
TokenCheck $tokenCheck,
JsonHelper $jsonHelper,
Helper $helper,
QuoteRepository $quoteRepository,
JsonResultFactory $jsonResultFactory,
QuoteValidator $quoteValidator,
\Afterpay\Afterpay\Model\Adapter\V2\AfterpayOrderDirectCapture $directCapture,
\Afterpay\Afterpay\Model\Adapter\V2\AfterpayOrderAuthRequest $authRequest,
\Afterpay\Afterpay\Model\Adapter\AfterpayPayment $afterpayApiPayment,
\Afterpay\Afterpay\Model\Adapter\AfterpayPayment $afterpayApiPayment,
\Magento\Quote\Model\QuoteManagement $quoteManagement,
ExpressPayment $expressPayment,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone)
{
$this->_checkoutSession = $checkoutSession;
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone,
\Afterpay\Afterpay\Model\ExpressPayment\ShippingListProvider $shippingListProvider
) {
$this->_checkoutSession = $checkoutSession;
$this->_objectManager = $objectManager;
$this->_quoteFactory = $quoteFactory;
$this->_afterpayConfig = $afterpayConfig;
$this->_afterpayOrderTokenV2 = $afterpayOrderTokenV2;
$this->_tokenCheck = $tokenCheck;
$this->_jsonHelper = $jsonHelper;
$this->_helper = $helper;
$this->_helper = $helper;
$this->_quoteRepository = $quoteRepository;
$this->_jsonResultFactory = $jsonResultFactory;
$this->_quoteValidator = $quoteValidator;
$this->_quoteValidator = $quoteValidator;
$this->_directCapture = $directCapture;
$this->_authRequest = $authRequest;
$this->_afterpayApiPayment = $afterpayApiPayment;
$this->_quoteManagement = $quoteManagement;
$this->_expressPayment=$expressPayment;
$this->_expressPayment=$expressPayment;
$this->_timezone = $timezone;
$this->shippingListProvider = $shippingListProvider;

parent::__construct($context);
}
Expand Down Expand Up @@ -244,42 +247,8 @@ public function _change()
$this->_checkoutSession->replaceQuote($quote);
}

$shippingData = $this->_expressPayment->getShippingDetails($quote);
$shippingList = array();
if (! empty($shippingData)) {
foreach ($shippingData as $rateData) {
$shippingAmount = $rateData->getBaseAmount();
$taxAmount = $shippingAddress->getBaseTaxAmount();
$orderAmount = $quote->getBaseSubtotalWithDiscount() + $shippingAmount + $taxAmount;
if($this->_expressPayment->isValidOrderAmount($orderAmount)){
$carrierCode = $rateData->getCarrierCode();
$methodCode = $rateData->getMethodCode();
$shippingOptions['id'] = $carrierCode . "_" . $methodCode;
$shippingOptions['name'] = $rateData->getCarrierTitle();
$shippingOptions['description'] = $rateData->getCarrierTitle();


$shippingOptions['shippingAmount'] = array(
'amount' => $this->_expressPayment->formatAmount($shippingAmount),
'currency' => $quote->getStoreCurrencyCode()
);


$shippingOptions['taxAmount'] = array(
'amount' => $this->_expressPayment->formatAmount($taxAmount),
'currency' => $quote->getBaseCurrencyCode()
);


$shippingOptions['orderAmount'] = array(
'amount' => $this->_expressPayment->formatAmount($orderAmount),
'currency' => $quote->getBaseCurrencyCode()
);

$shippingList[] = $shippingOptions;
}
}
}
$shippingList = $this->shippingListProvider->provide($quote);

$this->_helper->debug("Shipping Estimation Rates", $shippingList);
if (! empty($shippingList)) {
$result = $result = $this->_jsonResultFactory->create()->setData([
Expand Down
2 changes: 1 addition & 1 deletion Controller/Payment/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Controller\Payment;

Expand Down
2 changes: 1 addition & 1 deletion Controller/Payment/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay Payment
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Controller\Payment;

Expand Down
2 changes: 1 addition & 1 deletion Helper/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay Payment
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Helper;

Expand Down
2 changes: 1 addition & 1 deletion Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay Payment
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Helper;

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2016-2020 Afterpay Touch Group Limited
Copyright 2016-2021 Afterpay Touch Group Limited

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Model/Adapter/Afterpay/AfterpayClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay Payment
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter\Afterpay;

Expand Down
2 changes: 1 addition & 1 deletion Model/Adapter/Afterpay/AfterpayResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay Payment
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter\Afterpay;

Expand Down
2 changes: 1 addition & 1 deletion Model/Adapter/Afterpay/Call.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Magento 2 extensions for Afterpay Payment
*
* @author Afterpay
* @copyright 2016-2020 Afterpay https://www.afterpay.com
* @copyright 2016-2021 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter\Afterpay;

Expand Down
Loading

0 comments on commit 475d026

Please sign in to comment.