Skip to content

Commit 67a1071

Browse files
author
Yu Tang
committed
Merge branch 'develop' into FearlessKiwis-MAGETWO-46808-zero_subtotal
2 parents b1b726f + d31d651 commit 67a1071

File tree

644 files changed

+20102
-5796
lines changed

Some content is hidden

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

644 files changed

+20102
-5796
lines changed

.htaccess

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,3 @@
285285
## http://developer.yahoo.com/performance/rules.html#etags
286286

287287
#FileETag none
288-
289-
############################################
290-
## Add custom headers
291-
<IfModule mod_headers.c>
292-
Header set X-Content-Type-Options "nosniff"
293-
Header set X-XSS-Protection "1; mode=block"
294-
</IfModule>

app/code/Magento/Authorizenet/Test/Unit/Model/DirectpostTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public function testCheckResponseCodeFailure($responseCode)
331331
$this->dataHelperMock->expects($this->any())
332332
->method('wrapGatewayError')
333333
->with($reasonText)
334-
->willReturn(__('Gateway error: ' . $reasonText));
334+
->willReturn(__('Gateway error: %1', $reasonText));
335335

336336
$this->directpost->checkResponseCode();
337337
}

app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function execute()
4040
} catch (\Magento\Framework\Exception\LocalizedException $e) {
4141
$this->messageManager->addError($e->getMessage());
4242
} catch (\Exception $e) {
43-
$this->messageManager->addException($e, __('Unable to delete store. Please, try again later.'));
43+
$this->messageManager->addException($e, __('Unable to delete the store. Please try again later.'));
4444
}
4545
return $redirectResult->setPath('adminhtml/*/editGroup', ['group_id' => $itemId]);
4646
}

app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function execute()
4444
} catch (\Magento\Framework\Exception\LocalizedException $e) {
4545
$this->messageManager->addError($e->getMessage());
4646
} catch (\Exception $e) {
47-
$this->messageManager->addException($e, __('Unable to delete store view. Please, try again later.'));
47+
$this->messageManager->addException($e, __('Unable to delete the store view. Please try again later.'));
4848
}
4949
return $redirectResult->setPath('adminhtml/*/editStore', ['store_id' => $itemId]);
5050
}

app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function execute()
4242
} catch (\Magento\Framework\Exception\LocalizedException $e) {
4343
$this->messageManager->addError($e->getMessage());
4444
} catch (\Exception $e) {
45-
$this->messageManager->addException($e, __('Unable to delete website. Please, try again later.'));
45+
$this->messageManager->addException($e, __('Unable to delete the website. Please try again later.'));
4646
}
4747
return $redirectResult->setPath('*/*/editWebsite', ['website_id' => $itemId]);
4848
}

app/code/Magento/Backend/etc/adminhtml/di.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@
127127
</argument>
128128
</arguments>
129129
</type>
130-
<type name="Magento\Framework\App\Response\XFrameOptPlugin">
130+
<type name="Magento\Framework\App\Response\HeaderProvider\XFrameOptions">
131131
<arguments>
132-
<argument name="xFrameOpt" xsi:type="const">Magento\Framework\App\Response\XFrameOptPlugin::BACKEND_X_FRAME_OPT</argument>
132+
<argument name="xFrameOpt" xsi:type="const">Magento\Framework\App\Response\HeaderProvider\XFrameOptions::BACKEND_X_FRAME_OPT</argument>
133133
</arguments>
134134
</type>
135135
<preference for="Magento\Framework\App\Router\PathConfigInterface" type="Magento\Backend\Model\AdminPathConfig" />

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
191191
</field>
192192
<field id="enable_js_bundling" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
193-
<label>Enable Javascript Bundling</label>
193+
<label>Enable JavaScript Bundling</label>
194194
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
195195
</field>
196196
<field id="minify_files" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
@@ -215,7 +215,7 @@
215215
<label>Image Adapter</label>
216216
<source_model>Magento\Config\Model\Config\Source\Image\Adapter</source_model>
217217
<backend_model>Magento\Config\Model\Config\Backend\Image\Adapter</backend_model>
218-
<comment>When the adapter was changed, please, flush Catalog Images Cache.</comment>
218+
<comment>When the adapter was changed, please flush Catalog Images Cache.</comment>
219219
</field>
220220
</group>
221221
<group id="static" translate="label" type="text" sortOrder="130" showInDefault="1" showInWebsite="0" showInStore="0">
@@ -520,7 +520,27 @@
520520
<backend_model>Magento\Config\Model\Config\Backend\Secure</backend_model>
521521
<comment>Enter https protocol to use Secure URLs in Admin.</comment>
522522
</field>
523-
<field id="offloader_header" translate="label" type="text" sortOrder="70" showInDefault="1" showInWebsite="0" showInStore="0">
523+
<field id="enable_hsts" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
524+
<label>Enable HTTP Strict Transport Security (HSTS)</label>
525+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
526+
<backend_model>Magento\Config\Model\Config\Backend\Secure</backend_model>
527+
<comment><![CDATA[See <a href="https://www.owasp.org/index.php/HTTP_Strict_Transport_Security" target="_blank">HTTP Strict Transport Security</a> page for details.]]></comment>
528+
<depends>
529+
<field id="use_in_frontend">1</field>
530+
<field id="use_in_adminhtml">1</field>
531+
</depends>
532+
</field>
533+
<field id="enable_upgrade_insecure" translate="label" type="select" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
534+
<label>Upgrade Insecure Requests</label>
535+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
536+
<backend_model>Magento\Config\Model\Config\Backend\Secure</backend_model>
537+
<comment><![CDATA[See <a href="http://www.w3.org/TR/upgrade-insecure-requests/" target="_blank">Upgrade Insecure Requests</a> page for details.]]></comment>
538+
<depends>
539+
<field id="use_in_frontend">1</field>
540+
<field id="use_in_adminhtml">1</field>
541+
</depends>
542+
</field>
543+
<field id="offloader_header" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="0" showInStore="0">
524544
<label>Offloader header</label>
525545
</field>
526546
</group>

app/code/Magento/Backend/etc/di.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,11 @@
169169
</argument>
170170
</arguments>
171171
</type>
172+
<type name="Magento\Framework\App\Response\HeaderManager">
173+
<arguments>
174+
<argument name="headerProviderList" xsi:type="array">
175+
<item name="x-frame-options" xsi:type="object">Magento\Framework\App\Response\HeaderProvider\XFrameOptions</item>
176+
</argument>
177+
</arguments>
178+
</type>
172179
</config>

app/code/Magento/Backend/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ YTD,YTD
306306
"Maximum sender name length is 255. Please correct your settings.","Maximum sender name length is 255. Please correct your settings."
307307
"The file you're uploading exceeds the server size limit of %1 kilobytes.","The file you're uploading exceeds the server size limit of %1 kilobytes."
308308
"The base directory to upload file is not specified.","The base directory to upload file is not specified."
309-
"The specified image adapter cannot be used because of: ","The specified image adapter cannot be used because of: "
309+
"The specified image adapter cannot be used because of: %1","The specified image adapter cannot be used because of: %1"
310310
"Default scope","Default scope"
311311
"Base currency","Base currency"
312312
"Display default currency","Display default currency"

app/code/Magento/Backend/view/adminhtml/templates/page/js/require_js.phtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@
77
<script>
88
var BASE_URL = '<?php /* @escapeNotVerified */ echo $block->getUrl('*') ?>';
99
var FORM_KEY = '<?php /* @escapeNotVerified */ echo $block->getFormKey() ?>';
10+
var require = {
11+
"baseUrl": "<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('/') ?>"
12+
};
1013
</script>

app/code/Magento/Backend/view/adminhtml/templates/system/cache/additional.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<button onclick="setLocation('<?php /* @escapeNotVerified */ echo $block->getCleanMediaUrl() ?>')" type="button">
2121
<?php /* @escapeNotVerified */ echo __('Flush JavaScript/CSS Cache') ?>
2222
</button>
23-
<span><?php /* @escapeNotVerified */ echo __('Themes JavaScript and CSS files combined to one file.') ?></span>
23+
<span><?php /* @escapeNotVerified */ echo __('Themes JavaScript and CSS files combined to one file') ?></span>
2424
</p>
2525
<?php
2626
if (!$block->isInProductionMode()):

app/code/Magento/Braintree/Test/Unit/Model/System/Config/Backend/CountrycreditcardTest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,25 @@ class CountrycreditcardTest extends \PHPUnit_Framework_TestCase
2626
*/
2727
protected $objectManagerHelper;
2828

29-
/**
30-
* @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject
31-
*/
32-
protected $resourceMock;
33-
3429
/**
3530
* @var \Magento\Framework\Math\Random|\PHPUnit_Framework_MockObject_MockObject
3631
*/
3732
protected $mathRandomMock;
3833

3934
protected function setUp()
4035
{
41-
$this->resourceMock = $this->getMockForAbstractClass('\Magento\Framework\Model\ResourceModel\AbstractResource');
36+
$this->objectManagerHelper = new ObjectManagerHelper($this);
37+
4238
$this->mathRandomMock = $this->getMockBuilder(
4339
'\Magento\Framework\Math\Random'
4440
)->disableOriginalConstructor()
4541
->getMock();
4642

47-
$this->objectManagerHelper = new ObjectManagerHelper($this);
43+
4844
$this->model = $this->objectManagerHelper->getObject(
4945
'\Magento\Braintree\Model\System\Config\Backend\Countrycreditcard',
5046
[
51-
'mathRandom' => $this->mathRandomMock,
52-
'resource' => $this->resourceMock,
47+
'mathRandom' => $this->mathRandomMock
5348
]
5449
);
5550
}

app/code/Magento/Braintree/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<config_path>payment/braintree/debug</config_path>
8282
</field>
8383
<field id="capture_action" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="0">
84-
<label>Capture action</label>
84+
<label>Capture Action</label>
8585
<source_model>Magento\Braintree\Model\Source\CaptureAction</source_model>
8686
<config_path>payment/braintree/capture_action</config_path>
8787
</field>

app/code/Magento/BraintreeTwo/Block/Adminhtml/Form/Field/Cctypes.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
/**
1313
* Class Cctypes
14-
* @package Magento\BraintreeTwo\Block\Adminhtml\Form\Field
1514
*/
1615
class Cctypes extends Select
1716
{

app/code/Magento/BraintreeTwo/Block/Adminhtml/Form/Field/Countries.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
/**
1313
* Class Countries
14-
* @package Magento\BraintreeTwo\Block\Adminhtml\Form\Field
1514
*/
1615
class Countries extends Select
1716
{

app/code/Magento/BraintreeTwo/Block/Adminhtml/Form/Field/CountryCreditCard.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
/**
1212
* Class CountryCreditCard
13-
* @package Magento\BraintreeTwo\Block\Adminhtml\Form\Field
1413
*/
1514
class CountryCreditCard extends AbstractFieldArray
1615
{

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
/**
1616
* Class Form
17-
* @package Magento\BraintreeTwo\Block
1817
*/
1918
class Form extends Cc
2019
{

app/code/Magento/BraintreeTwo/Block/Info.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
/**
1212
* Class Info
13-
* @package Magento\BraintreeTwo\Block
1413
*/
1514
class Info extends ConfigurableInfo
1615
{
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\BraintreeTwo\Controller\Payment;
7+
8+
use Magento\BraintreeTwo\Gateway\Command\GetPaymentNonceCommand;
9+
use Magento\Customer\Model\Session;
10+
use Magento\Framework\App\Action\Action;
11+
use Magento\Framework\App\Action\Context;
12+
use Magento\Framework\Controller\ResultFactory;
13+
use Magento\Framework\Controller\ResultInterface;
14+
use Magento\Framework\Webapi\Exception;
15+
use Psr\Log\LoggerInterface;
16+
17+
/**
18+
* Class GetNonce
19+
*/
20+
class GetNonce extends Action
21+
{
22+
/**
23+
* @var LoggerInterface
24+
*/
25+
private $logger;
26+
27+
/**
28+
* @var Session
29+
*/
30+
private $session;
31+
32+
/**
33+
* @var GetPaymentNonceCommand
34+
*/
35+
private $command;
36+
37+
/**
38+
* @param Context $context
39+
* @param LoggerInterface $logger
40+
* @param Session $session
41+
* @param GetPaymentNonceCommand $command
42+
*/
43+
public function __construct(
44+
Context $context,
45+
LoggerInterface $logger,
46+
Session $session,
47+
GetPaymentNonceCommand $command
48+
) {
49+
parent::__construct($context);
50+
$this->logger = $logger;
51+
$this->session = $session;
52+
$this->command = $command;
53+
}
54+
55+
/**
56+
* @inheritdoc
57+
*/
58+
public function execute()
59+
{
60+
$response = $this->resultFactory->create(ResultFactory::TYPE_JSON);
61+
62+
try {
63+
$publicHash = $this->getRequest()->getParam('public_hash');
64+
$customerId = $this->session->getCustomerId();
65+
$result = $this->command->execute(['publicHash' => $publicHash, 'customerId' => $customerId])
66+
->get();
67+
$response->setData(['paymentMethodNonce' => $result['paymentMethodNonce']]);
68+
69+
} catch (\Exception $e) {
70+
$this->logger->critical($e);
71+
return $this->processBadRequest($response);
72+
}
73+
74+
return $response;
75+
}
76+
77+
/**
78+
* Return response for bad request
79+
* @param ResultInterface $response
80+
* @return ResultInterface
81+
*/
82+
private function processBadRequest(ResultInterface $response)
83+
{
84+
$response->setHttpResponseCode(Exception::HTTP_BAD_REQUEST);
85+
$response->setData(['message' => __('Sorry, but something went wrong')]);
86+
87+
return $response;
88+
}
89+
}

app/code/Magento/BraintreeTwo/Controller/Token/GetClientToken.php

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)