Skip to content

Commit ab10b9c

Browse files
author
Sergey Shvets
committed
Merge branch '2.1-develop' of github.com:magento/magento2ce into MAGETWO-83646
2 parents 4e6b770 + 27e8615 commit ab10b9c

File tree

265 files changed

+10111
-2071
lines changed

Some content is hidden

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

265 files changed

+10111
-2071
lines changed

app/code/Magento/Authorizenet/Controller/Directpost/Payment.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ protected function _responseAction($area = 'frontend')
7373
$helper = $this->dataFactory->create($area);
7474

7575
$params = [];
76-
$data = $this->getRequest()->getPostValue();
76+
$data = $this->getRequest()->getParams();
77+
7778
/* @var $paymentMethod \Magento\Authorizenet\Model\DirectPost */
7879
$paymentMethod = $this->_objectManager->create('Magento\Authorizenet\Model\Directpost');
7980

@@ -110,9 +111,8 @@ protected function _responseAction($area = 'frontend')
110111
$params['redirect'] = $helper->getRedirectIframeUrl($result);
111112
}
112113

114+
//registering parameter for iframe content
113115
$this->_coreRegistry->register(Iframe::REGISTRY_KEY, $params);
114-
$this->_view->addPageLayoutHandles();
115-
$this->_view->loadLayout(false)->renderLayout();
116116
}
117117

118118
/**

app/code/Magento/Authorizenet/Controller/Directpost/Payment/BackendResponse.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct(
5252
* Response action.
5353
* Action for Authorize.net SIM Relay Request.
5454
*
55-
* @return void
55+
* @return \Magento\Framework\Controller\ResultInterface
5656
*/
5757
public function execute()
5858
{
@@ -67,10 +67,11 @@ public function execute()
6767
$paymentMethod->validateResponse();
6868
} catch (LocalizedException $e) {
6969
$this->logger->critical($e->getMessage());
70-
$this->_redirect('noroute');
71-
return;
70+
71+
return $this->_redirect('noroute');
7272
}
7373
$this->_responseAction('adminhtml');
74-
$this->resultFactory->create(ResultFactory::TYPE_PAGE);
74+
75+
return $this->resultFactory->create(ResultFactory::TYPE_PAGE);
7576
}
7677
}

app/code/Magento/Authorizenet/Controller/Directpost/Payment/Response.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ class Response extends \Magento\Authorizenet\Controller\Directpost\Payment
1212
* Response action.
1313
* Action for Authorize.net SIM Relay Request.
1414
*
15-
* @return void
15+
* @return \Magento\Framework\Controller\ResultInterface
1616
*/
1717
public function execute()
1818
{
1919
$this->_responseAction('frontend');
20+
21+
return $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_PAGE);
2022
}
2123
}

app/code/Magento/Authorizenet/Model/Authorizenet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ protected function buildRequest(\Magento\Framework\DataObject $payment)
332332
->setXCity($billing->getCity())
333333
->setXState($billing->getRegion())
334334
->setXZip($billing->getPostcode())
335-
->setXCountry($billing->getCountry())
335+
->setXCountry($billing->getCountryId())
336336
->setXPhone($billing->getTelephone())
337337
->setXFax($billing->getFax())
338338
->setXCustId($order->getCustomerId())
@@ -352,7 +352,7 @@ protected function buildRequest(\Magento\Framework\DataObject $payment)
352352
->setXShipToCity($shipping->getCity())
353353
->setXShipToState($shipping->getRegion())
354354
->setXShipToZip($shipping->getPostcode())
355-
->setXShipToCountry($shipping->getCountry());
355+
->setXShipToCountry($shipping->getCountryId());
356356
}
357357

358358
$request->setXPoNum($payment->getPoNumber())

app/code/Magento/Authorizenet/Model/Directpost.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,11 @@ protected function processPaymentFraudStatus(\Magento\Sales\Model\Order\Payment
747747
return $this;
748748
}
749749

750-
$payment->setIsFraudDetected(true);
750+
$fdsFilterAction = (string)$fraudDetailsResponse->getFdsFilterAction();
751+
if ($this->fdsFilterActionIsReportOnly($fdsFilterAction) === false) {
752+
$payment->setIsFraudDetected(true);
753+
}
754+
751755
$payment->setAdditionalInformation('fraud_details', $fraudData);
752756
} catch (\Exception $e) {
753757
//this request is optional
@@ -993,4 +997,16 @@ private function getPsrLogger()
993997
}
994998
return $this->psrLogger;
995999
}
1000+
1001+
/**
1002+
* Checks if filter action is Report Only. Transactions that trigger this filter are processed as normal,
1003+
* but are also reported in the Merchant Interface as triggering this filter.
1004+
*
1005+
* @param string $fdsFilterAction
1006+
* @return bool
1007+
*/
1008+
private function fdsFilterActionIsReportOnly($fdsFilterAction)
1009+
{
1010+
return $fdsFilterAction === (string)$this->dataHelper->getFdsFilterActionLabel('report');
1011+
}
9961012
}

app/code/Magento/Authorizenet/Model/Directpost/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function setDataFromOrder(
123123
->setXCity(strval($billing->getCity()))
124124
->setXState(strval($billing->getRegion()))
125125
->setXZip(strval($billing->getPostcode()))
126-
->setXCountry(strval($billing->getCountry()))
126+
->setXCountry(strval($billing->getCountryId()))
127127
->setXPhone(strval($billing->getTelephone()))
128128
->setXFax(strval($billing->getFax()))
129129
->setXCustId(strval($billing->getCustomerId()))
@@ -151,7 +151,7 @@ public function setDataFromOrder(
151151
)->setXShipToZip(
152152
strval($shipping->getPostcode())
153153
)->setXShipToCountry(
154-
strval($shipping->getCountry())
154+
strval($shipping->getCountryId())
155155
);
156156
}
157157

app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/**
1414
* "Reset to Defaults" button renderer
1515
*
16+
* @deprecated
1617
* @author Magento Core Team <core@magentocommerce.com>
1718
*/
1819
class Reset extends \Magento\Config\Block\System\Config\Form\Field

app/code/Magento/Backend/Test/Unit/Block/Page/System/Config/Robots/ResetTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
*/
1010
namespace Magento\Backend\Test\Unit\Block\Page\System\Config\Robots;
1111

12+
/**
13+
* Class ResetTest
14+
* @deprecated
15+
* @package Magento\Backend\Test\Unit\Block\Page\System\Config\Robots
16+
*/
1217
class ResetTest extends \PHPUnit_Framework_TestCase
1318
{
1419
/**

app/code/Magento/Braintree/Block/Form.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
*/
2222
class Form extends Cc
2323
{
24-
2524
/**
2625
* @var Quote
2726
*/
@@ -81,7 +80,7 @@ public function getCcAvailableTypes()
8180
*/
8281
public function useCvv()
8382
{
84-
return $this->gatewayConfig->isCvvEnabled();
83+
return $this->gatewayConfig->isCvvEnabled($this->sessionQuote->getStoreId());
8584
}
8685

8786
/**
@@ -90,9 +89,8 @@ public function useCvv()
9089
*/
9190
public function isVaultEnabled()
9291
{
93-
$storeId = $this->_storeManager->getStore()->getId();
9492
$vaultPayment = $this->getVaultPayment();
95-
return $vaultPayment->isActive($storeId);
93+
return $vaultPayment->isActive($this->sessionQuote->getStoreId());
9694
}
9795

9896
/**
@@ -102,7 +100,10 @@ public function isVaultEnabled()
102100
private function getConfiguredCardTypes()
103101
{
104102
$types = $this->ccType->getCcTypeLabelMap();
105-
$configCardTypes = array_fill_keys($this->gatewayConfig->getAvailableCardTypes(), '');
103+
$configCardTypes = array_fill_keys(
104+
$this->gatewayConfig->getAvailableCardTypes($this->sessionQuote->getStoreId()),
105+
''
106+
);
106107

107108
return array_intersect_key($types, $configCardTypes);
108109
}
@@ -116,7 +117,11 @@ private function getConfiguredCardTypes()
116117
private function filterCardTypesForCountry(array $configCardTypes, $countryId)
117118
{
118119
$filtered = $configCardTypes;
119-
$countryCardTypes = $this->gatewayConfig->getCountryAvailableCardTypes($countryId);
120+
$countryCardTypes = $this->gatewayConfig->getCountryAvailableCardTypes(
121+
$countryId,
122+
$this->sessionQuote->getStoreId()
123+
);
124+
120125
// filter card types only if specific card types are set for country
121126
if (!empty($countryCardTypes)) {
122127
$availableTypes = array_fill_keys($countryCardTypes, '');

app/code/Magento/Braintree/Block/Payment.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ public function getPaymentConfig()
4444
$payment = $this->config->getConfig()['payment'];
4545
$config = $payment[$this->getCode()];
4646
$config['code'] = $this->getCode();
47+
$config['clientTokenUrl'] = $this->_urlBuilder->getUrl(
48+
'braintree/payment/getClientToken',
49+
['_secure' => true]
50+
);
4751
return json_encode($config, JSON_UNESCAPED_SLASHES);
4852
}
4953

0 commit comments

Comments
 (0)