Skip to content

Commit

Permalink
Release version 3.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
afterpayplugins committed Jan 23, 2020
1 parent 54f0ab1 commit 40b41ea
Show file tree
Hide file tree
Showing 79 changed files with 777 additions and 358 deletions.
2 changes: 1 addition & 1 deletion Block/Adminhtml/Order/Creditmemo/Create/Items.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Block\Adminhtml\Order\Creditmemo\Create;

Expand Down
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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Block\Adminhtml\System\Config\Form\Field;

Expand Down
2 changes: 1 addition & 1 deletion Block/Cart/Button.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Block\Cart;

Expand Down
2 changes: 1 addition & 1 deletion Block/Catalog/Installments.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Block\Catalog;

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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 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.1.2

_Fri 24 Jan 2020 (AEDT)_

### Supported Editions & Versions

- Magento Community Edition (CE) version 2.0.2 and later
- Magento Enterprise Edition (EE) version 2.0.2 and later

### Highlights

- Improved handling of Store Credit and Gift Cards in Magento Enterprise.
- Improved handling of unusual AJAX behaviour at the checkout.
- Replaced legacy internal assets with latest artwork hosted on the Afterpay CDN.
- Added a cron job for Deferred Payment Flow to create Credit Memos in Magento if a payment Auth is allowed to expire.
- Added a new field on the Magento Invoice to show when a payment Auth will expire.

---

## Version 3.1.1

_Tue 24 Dec 2019 (AEDT)_
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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Controller\Payment;

Expand Down
21 changes: 17 additions & 4 deletions 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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Controller\Payment;

Expand Down Expand Up @@ -38,6 +38,7 @@ class Response extends \Magento\Framework\App\Action\Action
protected $_notifierPool;
protected $_paymentCapture;
protected $_quoteValidator;
protected $_timezone;

/**
* Response constructor.
Expand Down Expand Up @@ -78,7 +79,8 @@ public function __construct(
\Magento\Sales\Model\Order\Payment\Transaction\Repository $transactionRepository,
\Magento\Framework\Notification\NotifierInterface $notifierPool,
\Afterpay\Afterpay\Model\Adapter\V2\AfterpayOrderPaymentCapture $paymentCapture,
\Magento\Quote\Model\QuoteValidator $quoteValidator
\Magento\Quote\Model\QuoteValidator $quoteValidator,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone
) {
$this->_resultForwardFactory = $resultForwardFactory;
$this->response = $response;
Expand All @@ -98,6 +100,7 @@ public function __construct(
$this->_notifierPool = $notifierPool;
$this->_paymentCapture = $paymentCapture;
$this->_quoteValidator = $quoteValidator;
$this->_timezone = $timezone;

parent::__construct($context);
}
Expand Down Expand Up @@ -190,6 +193,16 @@ private function _processAuthCapture($query)

$payment->setAdditionalInformation(\Afterpay\Afterpay\Model\Payovertime::PAYMENT_STATUS,$response['paymentState']);

if($response['paymentState']==\Afterpay\Afterpay\Model\Response::PAYMENT_STATUS_AUTH_APPROVED && array_key_exists('events',$response)){
try{
$payment->setAdditionalInformation(\Afterpay\Afterpay\Model\Payovertime::AUTH_EXPIRY,$this->_timezone->date($response['events'][0]['expires'])->format('Y-m-d H:i T'));
}
catch(\Exception $e){
$payment->setAdditionalInformation(\Afterpay\Afterpay\Model\Payovertime::AUTH_EXPIRY,$this->_timezone->date($response['events'][0]['expires'],null,false)->format('Y-m-d H:i T'));
$this->_helper->debug($e->getMessage());
}
}

$payment->setAdditionalInformation(\Afterpay\Afterpay\Model\Payovertime::OPEN_TOCAPTURE_AMOUNT, array_key_exists('openToCaptureAmount',$response) && !empty($response['openToCaptureAmount']) ? $response['openToCaptureAmount']['amount'] : "0.00");

$this->_checkoutSession
Expand Down Expand Up @@ -315,8 +328,8 @@ private function _createTransaction($order = null, $paymentData = [],$payment=nu

$order->setBaseCustomerBalanceInvoiced(null);
$order->setCustomerBalanceInvoiced(null);

$this->_orderRepository->save($order);
$this->_orderRepository->save($order);

$transaction = $this->_transactionRepository->save($transaction);

return $transaction->getTransactionId();
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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 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-2019 Afterpay Touch Group Limited
Copyright 2016-2020 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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter\Afterpay;

Expand Down
5 changes: 3 additions & 2 deletions 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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter\Afterpay;

Expand Down Expand Up @@ -141,7 +141,8 @@ public function send($url, $body = false, $method = \Magento\Framework\HTTP\Zend
'httpStatusCode' => $response->getStatus(),
'body' => $this->obfuscateCustomerData($this->jsonHelper->jsonDecode($response->getBody()))
];
$this->helper->debug($this->jsonHelper->jsonEncode($responseLog));
$this->helper->debug($this->jsonHelper->jsonEncode($responseLog));

} catch (\Exception $e) {
$this->helper->debug($e->getMessage());

Expand Down
2 changes: 1 addition & 1 deletion Model/Adapter/AfterpayPayment.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter;

Expand Down
2 changes: 1 addition & 1 deletion Model/Adapter/AfterpayTotalLimit.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter;

Expand Down
2 changes: 1 addition & 1 deletion Model/Adapter/ApiMode.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter;

Expand Down
2 changes: 1 addition & 1 deletion Model/Adapter/V2/AfterpayOrderAuthRequest.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter\V2;

Expand Down
2 changes: 1 addition & 1 deletion Model/Adapter/V2/AfterpayOrderDirectCapture.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter\V2;

Expand Down
2 changes: 1 addition & 1 deletion Model/Adapter/V2/AfterpayOrderPaymentCapture.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter\V2;

Expand Down
2 changes: 1 addition & 1 deletion Model/Adapter/V2/AfterpayOrderTokenCheck.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter\V2;

Expand Down
2 changes: 1 addition & 1 deletion Model/Adapter/V2/AfterpayOrderTokenV2.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Adapter\V2;

Expand Down
6 changes: 3 additions & 3 deletions Model/Config/Payovertime.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Config;

Expand Down Expand Up @@ -320,9 +320,9 @@ public function isDebugEnabled()
/**
* @return bool
*/
public function isActive()
public function isActive($override = [])
{
return (bool)(int)$this->_getConfigData(self::ACTIVE);
return (bool)(int)$this->_getConfigData(self::ACTIVE,$override);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Model/Config/Save/Plugin.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Config\Save;

Expand Down
2 changes: 1 addition & 1 deletion Model/ConfigProvider.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model;

Expand Down
2 changes: 1 addition & 1 deletion Model/Cron/Limit.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-2019 Afterpay https://www.afterpay.com
* @copyright 2016-2020 Afterpay https://www.afterpay.com
*/
namespace Afterpay\Afterpay\Model\Cron;

Expand Down
Loading

0 comments on commit 40b41ea

Please sign in to comment.